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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -