What is the purpose of Wildcard route in Angular?

If the URL does not match any predefined routes then it causes the router to throw an error and crash the app. In this case, the users can use wildcard route. A wildcard route has a path consisting of two asterisks to match every URL.

For example, we can define PageNotFoundComponent for wildcard route as below

{ path: '**', component: PageNotFoundComponent }