feat(aio): add LocationService.path() method (#16139)

This enables things like embedded components easy access to a clean version
of the current location path.
This commit is contained in:
Peter Bacon Darwin
2017-04-20 16:12:09 +01:00
committed by Miško Hevery
parent 5461182e25
commit 6ed812ff75
3 changed files with 43 additions and 0 deletions

View File

@ -7,6 +7,8 @@ export class MockLocationService {
setSearch = jasmine.createSpy('setSearch');
go = jasmine.createSpy('Location.go').and
.callFake((url: string) => this.urlSubject.next(url));
path = jasmine.createSpy('Location.path').and
.callFake(() => this.urlSubject.getValue().split('?')[0]);
handleAnchorClick = jasmine.createSpy('Location.handleAnchorClick')
.and.returnValue(false); // prevent click from causing a browser navigation