refactor(aio): switch to pipeable RxJS operators (#22872)

PR Close #22872
This commit is contained in:
George Kalpakas
2018-03-21 03:40:23 +02:00
committed by Matias Niemelä
parent da76db9601
commit 01d2dd2a3a
24 changed files with 196 additions and 192 deletions

View File

@ -1,10 +1,11 @@
import { BehaviorSubject } from 'rxjs';
import { map } from 'rxjs/operators';
export class MockLocationService {
urlSubject = new BehaviorSubject<string>(this.initialUrl);
currentUrl = this.urlSubject.asObservable().map(url => this.stripSlashes(url));
currentUrl = this.urlSubject.asObservable().pipe(map(url => this.stripSlashes(url)));
// strip off query and hash
currentPath = this.currentUrl.map(url => url.match(/[^?#]*/)![0]);
currentPath = this.currentUrl.pipe(map(url => url.match(/[^?#]*/)![0]));
search = jasmine.createSpy('search').and.returnValue({});
setSearch = jasmine.createSpy('setSearch');
go = jasmine.createSpy('Location.go').and