jmcooper / angular-fundamentals-files

353 stars 536 forks source link

Cannot read property 'loadChildren' of undefined #15

Closed dwoodger closed 4 years ago

dwoodger commented 4 years ago

At section 6, Lazily Loading Feature Modules. Just added to routes.ts: { path: 'user', loadChildren: './user/user.module#UserModule' }

Full export is:

export const appRoutes: Routes = [ { path: 'events/new', component: CreateEventComponent, canDeactivate: ['canDeactivateCreateEvent'] }, { path: 'events', component: EventsListComponent, resolve: { events: EventListResolver } }, { path: 'events/:id', component: EventDetailsComponent, canActivate: [EventRouteActivator] }, { path: '404', component: Error404Component }, { path: '', redirectTo: '/events', pathMatch: 'full' }, { path: 'user', loadChildren: './user/user.module#UserModule' } ];

But will not compile. Get: Cannot read property 'loadChildren' of undefined

dwoodger commented 4 years ago

Never mind. Fixed it. I got better errors on another day and found that a routerLink setting was missing an end bracket.