Skip to content

[Lazyload] newly loaded states use the wrong Injector #35

@aitboudad

Description

@aitboudad
// app-module.ts
@NgModule({
    imports: [
        UIRouterModule.forRoot({
            states: [
              { name: 'foo.**', url: '/foo', loadChildren: ... }
            ]
        })
    ],
})
export class AppModule {}
// foo-module.ts
@NgModule({
    imports: [
        UIRouterModule.forChild({
            states: [
                { name: 'foo', url: '/foo', component: ... },
                { name: 'bar', url: '/bar', component: ... }
             ]
        })
    ],
})
export class FooModule {}

Navigation to /bar after foo is loaded produce the following exception:

No component factory found for `BarComponent`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions