Angular | Routing | Redirects | Wildcards | English

preview_player
Показать описание
Steps to implement routing in angular

2. Add the following import statement.

3. Locate the @NgModule() section.

path refers to key comes in route url
component refers to component to redirect

3. Update your component with router-outlet

Setting up wildcard routes

A well-functioning application should gracefully handle when users attempt to navigate to a part of your application that does not exist. To add this functionality to your application, you set up a wildcard route. The Angular router selects this route any time the requested URL doesn't match any router paths.

Follow us on
Instagram : @core2cosmos
Facebook : core2cosmos
Twitter : @coretocosmos

Setting up redirects

To set up a redirect, configure a route with the path you want to redirect from, the component you want to redirect to, and a pathMatch value that tells the router how to match the URL.
Рекомендации по теме