javascript - Angular 2 RC5 and above - How to show an error page when no route matches? -
my current route config looks this
{ path: '', redirectto: 'register/account', pathmatch: 'full' }, { path: 'register/account', component: accountregistercomponent }, { path: 'register/auto/:id', component:autoregistercomponent },
if user tries navigate '/register/auto'. see blank page , error in console. how can show 404 error or message saying page not available globally?
see angular2 cheatsheet can this:
{path: '**', redirectto: '/404' }
so example have this:
{path: '/404', component: notfoundcomponent}, {path: '**', redirectto: '/404' }
hope helps
Comments
Post a Comment