Winkel-4 Lazy Loading und Routen, die nicht arbeiten

Habe ich ein Modul mit dem Strecken meiner app. Eine dieser Routen ist ein lazy loading-Modul.

Das problem ist, dass dieses lazy loading module haves innerhalb eines Routen für die untergeordneten Komponenten. Aber auf mein router config diese Routen nicht angezeigt wird... Also ich nenne das faul-Modul nicht alles zeigen auf meinem Bildschirm.

Hier ist mein router config (main-Modul):

export const MODULE_ROUTES: Route[] =[
    { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
    { path: 'dashboard', component: HomeComponent, canActivate: [AuthGuard] },
    { path: 'calendar', loadChildren: 'app/dashboard/calendar/calendar-module.module#CalendarModuleModule',canActivate: [AuthGuard]}, 
    { path: '**', component: NoPageFoundComponent, pathMatch: 'full' }
]
.
.
.


@NgModule({
    imports: [
        RouterModule.forChild(MODULE_ROUTES)
.
.
.

Auf meine faul-Modul:

export const MODULE_CALENDAR_ROUTES: Route[] = [
    {
        path: 'calendar', component: CalendarComponent, canActivateChild: [AuthGuard, CalendarGuard],
        children: [
            {
                path: '', component: MainCalendarComponent, canActivateChild: [AuthGuard, CalendarGuard]
            },
            {

                path: 'user', component: EditEventComponent, canActivateChild: [AuthGuard, CalendarGuard]
            }
        ]
    }
]

.
.
.

@NgModule({
    imports: [
        SharedModule,
.
.
.
        RouterModule.forChild(MODULE_CALENDAR_ROUTES)

Wenn ich drucken meine router config dieser Routen declaren auf meine faul-Modul nicht anzeigen:

Routes:  [
  {
    "path": "dashboard",
    "canActivate": [
      null
    ]
  },
  {
    "path": "calendar",
    "loadChildren": "app/dashboard/calendar/calendar-module.module#CalendarModuleModule",
    "canActivate": [
      null
    ]
  },
  {
    "path": "**",
    "pathMatch": "full"
  },
  {
    "path": "dashboard"
  }
]

Können Sie mir helfen?

haben Sie gesehen, dass irgendein Fehler in der Konsole nämlich nicht gefunden-Modul oder so etwas..

InformationsquelleAutor Ali Briceño | 2017-06-04

Schreibe einen Kommentar