From 928e2543cdcd63e85df3279f9771b677df6ac34a Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Sun, 2 Apr 2017 10:15:53 +0100 Subject: [PATCH] fix(aio): currentNode url should not contain hash or search --- aio/src/app/navigation/navigation.service.spec.ts | 4 ++-- aio/src/app/navigation/navigation.service.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aio/src/app/navigation/navigation.service.spec.ts b/aio/src/app/navigation/navigation.service.spec.ts index 2029db5f06..873fb927e5 100644 --- a/aio/src/app/navigation/navigation.service.spec.ts +++ b/aio/src/app/navigation/navigation.service.spec.ts @@ -148,8 +148,8 @@ describe('NavigationService', () => { }); }); - it('should be undefined if no side navigation node matches the current location', () => { - location.urlSubject.next('g'); + it('should be a plain object if no side navigation node matches the current location', () => { + location.urlSubject.next('g?search=moo#anchor-1'); expect(currentNode).toEqual({ url: 'g', view: '', diff --git a/aio/src/app/navigation/navigation.service.ts b/aio/src/app/navigation/navigation.service.ts index 28d47b7dac..d80c233473 100644 --- a/aio/src/app/navigation/navigation.service.ts +++ b/aio/src/app/navigation/navigation.service.ts @@ -95,7 +95,7 @@ export class NavigationService { (navMap, url) => { let urlKey = cleanUrl(url); urlKey = urlKey.startsWith('api/') ? 'api' : urlKey; - return navMap[urlKey] || { view: '', url, nodes: [] }; + return navMap[urlKey] || { view: '', url: urlKey, nodes: [] }; }) .publishReplay(1); currentNode.connect();