user10747832
user10747832

Reputation:

Angular: How to manage invalid url

Angular how to manage invalid url errors:

Here is my working url:

http://192.168.0.1:4200/jobs/quick-worker-list/1306/1

When i hit this url:

http://192.168.0.1:4200/jobs/quick-worker-list

Than, how can I manage such error with angular-router?

Upvotes: 1

Views: 2284

Answers (1)

Hrishikesh Kale
Hrishikesh Kale

Reputation: 6568

i hope you have a router config for this then you need to configure into your route config object

create a component for page not found

and add

{path: '404', component: NotFoundComponent},
{path: '**', redirectTo: '/404'}

it will Show the 404 page for any routes that don't exist.

Upvotes: 1

Related Questions