Skip to content

Commit 876e6ce

Browse files
committed
fixed AOT-error with not lazy loaded modules
Details: angular/angular-cli#4192 (comment)
1 parent 7c312c2 commit 876e6ce

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

client/src/app/app-routing.module.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { HomeComponent } from './modules/home/pages/home.component';
55
import { ProjectListComponent } from './modules/projects/components/project-list/project-list.component';
66
import { ProjectsModule } from './modules/projects/projects.module';
77

8+
89
export function getProjectModule() { return ProjectsModule };
910

1011
const indexRoute: Route = {
@@ -35,7 +36,8 @@ const routes: Routes = [
3536
},
3637
{
3738
path: 'projects',
38-
loadChildren: getProjectModule,
39+
loadChildren: './modules/projects/projects.module#ProjectsModule',
40+
// line above instead of loadChildren: getProjectModule according to: https://github.com/angular/angular-cli/issues/4192#issuecomment-274775116
3941
canActivate: [AuthGuard]
4042
},
4143
fallbackRoute

client/src/app/modules/projects/projects-routing.module.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const routes: Routes = [
4141
children: [
4242
{
4343
path: '',
44-
loadChildren: getInformationModule
44+
loadChildren: '../information/information.module#InformationModule'
45+
// line above instead of loadChildren: InformationModule according to: https://github.com/angular/angular-cli/issues/4192#issuecomment-274775116
4546
}
4647
]
4748
},

0 commit comments

Comments
 (0)