I use angular 9 and I want to do lazy load and I do app-routing
{
path: '', loadChildren: () => import("./components/login/login.module")//.then(m =>
// m.LoginModule)
}
and after I create login module:
@NgModule({
declarations: [LoginComponent],
imports: [
CommonModule,
FormsModule,
LoginModuleRouting
],
providers:[]
})
export class LoginModule { }
and routing:
const routes: Routes = [
{
path: '', component: LoginComponent,
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class LoginModuleRouting { }
the proble is that when I call ng serve
and I go on `http://localhost:4200/, I obtain this exception:
core.js:6237
ERROR Error: Uncaught (in promise): Error: ASSERTION ERROR: NgModule '[object Module]' is not a subtype of 'NgModuleType'. [Expected=> null != null <=Actual]
Error: ASSERTION ERROR: NgModule '[object Module]' is not a subtype of 'NgModuleType'. [Expected=> null != null <=Actual]
I don't knwo what it means. Anyone can help me?