fix(router): wildcards routes should support lazy loading

Closes #12024
This commit is contained in:
vsavkin
2016-10-05 15:37:32 -07:00
committed by Tobias Bosch
parent 1681e4f57f
commit 40b92ddf21
2 changed files with 21 additions and 1 deletions

View File

@ -292,6 +292,19 @@ describe('applyRedirects', () => {
},
(e) => { throw 'Should not reach'; });
});
it('should load the configuration of a whilecard route', () => {
const loadedConfig = new LoadedRouterConfig(
[{path: '', component: ComponentB}], <any>'stubInjector', <any>'stubFactoryResolver');
const loader = {load: (injector: any, p: any) => of (loadedConfig)};
const config = [{path: '**', loadChildren: 'children'}];
applyRedirects(<any>'providedInjector', <any>loader, tree('xyz'), config).forEach(r => {
expect((<any>config[0])._loadedConfig).toBe(loadedConfig);
});
});
});
describe('empty paths', () => {