fix(router): lazy loaded components should use loaded injector

This commit is contained in:
vsavkin
2016-07-18 16:07:12 -07:00
parent 7a4f6621ed
commit 921a17960c
4 changed files with 18 additions and 9 deletions

View File

@ -1279,14 +1279,17 @@ describe('Integration', () => {
[Router, TestComponentBuilder, Location, AppModuleFactoryLoader],
(router: Router, tcb: TestComponentBuilder, location: Location,
loader: SpyAppModuleFactoryLoader) => {
class LazyLoadedService {}
@Component({selector: 'lazy', template: 'lazy-loaded', directives: ROUTER_DIRECTIVES})
class LazyLoadedComponent {
constructor(service: LazyLoadedService) {}
}
@AppModule({
precompile: [LazyLoadedComponent],
providers: [
provideRoutes([{
LazyLoadedService, provideRoutes([{
path: '',
canActivate: ['alwaysTrue'],
children: [{path: 'loaded', component: LazyLoadedComponent}]