Bin mein Routing im Modul einstellen, und ich möchte Standard-Route setzen, aber es scheitertAngular2 Einstellung Standardroute
Dies ist das Routing-Modul
const appRoutes: Routes = [
{ path: 'login', component: LoginComponent, useAsDefault:true }, //returns an error
{
path: 'dash',
redirectTo:"dashboard"
},
{ path: 'reset-password', component: ResetPasswordComponent },
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: '**', component: PageNotFoundComponent }
];
Die oben gibt einen Fehler von
LoginComponent; useAsD...' is not assignable to type 'Route[]'
Was könnte
Bitte haben Sie einen Blick auf http://stackoverflow.com/questions/37605119/angular2-router-angular-router-how-to-set-default-route –
Was ist los? Sie haben eine nette und klare Antwort des Fehlers;) coz Router hatte keine 'useAsDefault'-Eigenschaft, überprüfen Sie es: https://angular.io/docs/ts/latest/api/router/index/Route-interface.html – Daredzik