fix(aio): currentNode url should not contain hash or search

This commit is contained in:
Peter Bacon Darwin 2017-04-02 10:15:53 +01:00 committed by Pete Bacon Darwin
parent 92e14a36f9
commit 928e2543cd
2 changed files with 3 additions and 3 deletions

View File

@ -148,8 +148,8 @@ describe('NavigationService', () => {
}); });
}); });
it('should be undefined if no side navigation node matches the current location', () => { it('should be a plain object if no side navigation node matches the current location', () => {
location.urlSubject.next('g'); location.urlSubject.next('g?search=moo#anchor-1');
expect(currentNode).toEqual({ expect(currentNode).toEqual({
url: 'g', url: 'g',
view: '', view: '',

View File

@ -95,7 +95,7 @@ export class NavigationService {
(navMap, url) => { (navMap, url) => {
let urlKey = cleanUrl(url); let urlKey = cleanUrl(url);
urlKey = urlKey.startsWith('api/') ? 'api' : urlKey; urlKey = urlKey.startsWith('api/') ? 'api' : urlKey;
return navMap[urlKey] || { view: '', url, nodes: [] }; return navMap[urlKey] || { view: '', url: urlKey, nodes: [] };
}) })
.publishReplay(1); .publishReplay(1);
currentNode.connect(); currentNode.connect();