Handling Unknown Route Paths
Learn how to handle unknown routes by setting up a default route and create a wildcard route in Angular.
We'll cover the following
We came across the concept of unknown routes. We set up a wildcard route to display PageNotFoundComponent
when our application tries to navigate to a route path that does not exist. Now, it is time to add that component for real:
Use the
generate
command of the Angular CLI to create a new component namedpage-not-found
:
Note: The command below is for creating a new component locally using the Angular CLI.
Get hands-on with 1400+ tech skills courses.