I'm trying to implement new lazyloaded module to app component, but when I trying to add child routes for new module
it throws 'router-outlet' is not a known element:in lazy loaded module error .
İn child module i import and export RouterModule .
const routes: Routes = [
{
path: '',
component: ProfileComponent,
children: [
{path: '', pathMatch: 'full', component: PostsComponent},
{path: 'media', component: MediaComponent},
{path: 'settings', component: SettingsComponent},
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ProfileRoutingModule {
}
and profile module (the module I trying to implement) I import the Profile
@NgModule({
declarations: [PostsComponent, MediaComponent, SettingsComponent],
imports: [
CommonModule,
SharedModule,
ProfileRoutingModule
]
})
export class ProfileModule {
}
and part of AppRoutingModule
{
path: 'profile',
loadChildren: () => import('./profile/profile.module')
.then(m => m.ProfileModule)
}
Other modules works pretty fine but when I try to lazy load module it gives me this error