Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/router/src/recognize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ function getChildConfig(route: Route): Route[] {
return route.children;
}

if (route.loadChildren) {
return route._loadedConfig !.routes;
if (route.loadChildren && route._loadedConfig) {
return route._loadedConfig.routes;
}

return [];
Expand Down
15 changes: 15 additions & 0 deletions packages/router/test/recognize.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,21 @@ describe('recognize', () => {
});
});
});

xdescribe('aux route with empty base path', () => {
it('should match auxillary route on root', () => {
checkRecognize(
[
{path: '', component: ComponentC, outlet: 'aux'},
{path: '', children: [{path: '', loadChildren: 'lazy'}]}
],
'', (s: RouterStateSnapshot) => {
const c = (s as any).children((s as any).firstChild(s.root) !);
checkActivatedRoute(c[0], '', {}, undefined !);
checkActivatedRoute(c[1], '', {}, ComponentC, 'aux');
});
});
});
});

function checkRecognize(
Expand Down