Angular · Junior · Question 58 of 75
How do you show a "Page not found" component for unknown URLs?
{ path: '**', component: NotFound }- ✓Correct answer: Add a wildcard route
**at the end of the routes array - 2Put
notFound: trueon the first route - 3Angular shows a 404 page automatically
Explanation
The router uses the first matching route, so the wildcard must be last, otherwise it would catch every URL.