Routing problem of a child module

2

I have a problem with routing that I can not fix.

I try to access the path / admin / login and it directs me to the root with a blank page and the following error in the console:

ZoneAwareError {__zone_symbol__error: Error: Uncaught (in promise): Error
Error
    at Error.ZoneAwareError (http://localhost:4200/polyfil……}

The other routes if they work

app.routing.module.ts

const appRoutes: Routes = [
    { path: 'admin', loadChildren: 'app/admin/admin.module#AdminModule'},
    { path: '', component: HomeComponent }
];

@NgModule({
    imports: [ RouterModule.forRoot(appRoutes) ],
    exports: [ RouterModule ]
})

admin.routing.module.ts

const AdminRoutes: Routes = [
    { path: 'login', component: AdminLoginComponent },
    { path: 'home', component: AdminHomeComponent },
    { path: '', component: AdminComponent },
];

@NgModule({
    imports: [ RouterModule.forChild(AdminRoutes) ],
    exports: [ RouterModule ]
})
    
asked by Apicito Diaz 17.04.2017 в 10:08
source

1 answer

0

I autorespond to say that the problem was in the login component itself, even though I have not managed to find out what it was, not in routing. I proceeded to remove the component and recreate it and everything works. Greetings.

    
answered by 17.04.2017 в 10:28