Search⌘ K

Wildcard Routes

Explore how to handle unknown routes in Angular by creating wildcard routes and a custom 404 component. Understand route order importance and learn to configure routing to improve user experience with dynamic error handling.

There’s one more route we’re going to add. Currently, the user can navigate around with the links. What if they navigate to a page that doesn’t exist? Try to input a random path in the address bar.

If they attempt to navigate to a page that doesn’t exist, the application will throw an error. It’s telling us that the path doesn’t match any of the routes registered in the application. Typically, most applications and sites will display a 404 not found page if we visit a resource that doesn’t exist. We’ll want to do the same.

Wildcards

Wildcard routes are routes that can capture any route. This is useful for capturing ...