feat(router): add support for lazily loaded modules
This commit is contained in:
@ -122,7 +122,7 @@ function processPathsWithParamsAgainstRoute(
|
||||
|
||||
const {consumedPaths, parameters, lastChild} = match(rawSegment, route, paths);
|
||||
const rawSlicedPath = paths.slice(lastChild);
|
||||
const childConfig = route.children ? route.children : [];
|
||||
const childConfig = getChildConfig(route);
|
||||
const newInherited = route.component ?
|
||||
InheritedFromParent.empty :
|
||||
new InheritedFromParent(inherited, parameters, getData(route), newInheritedResolve);
|
||||
@ -149,6 +149,16 @@ function processPathsWithParamsAgainstRoute(
|
||||
}
|
||||
}
|
||||
|
||||
function getChildConfig(route: Route): Route[] {
|
||||
if (route.children) {
|
||||
return route.children;
|
||||
} else if (route.mountChildren) {
|
||||
return (<any>route)._loadedConfig.routes;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function match(segment: UrlSegment, route: Route, paths: UrlPathWithParams[]) {
|
||||
if (route.path === '') {
|
||||
if ((route.terminal || route.pathMatch === 'full') &&
|
||||
|
Reference in New Issue
Block a user