Perform Routing in Your App
Explore how to implement routing in an Angular e-commerce app by defining routes for various components like home, product listing, cart, and error page. Understand using router-outlet as a placeholder and how to configure location strategies to manage path and hash-based routing. Learn to work with route parameters to display dynamic content.
We'll cover the following...
We'll cover the following...
As per the feature segregation that we did in the previous lesson, we now know that there are mainly five different views that can be routed to.
- Home Component/Dashboard Component
- Profile Component
- Product Listing Component
- Product detail component
- Cart component
And we saw in the routing section we can specify a redirect path and a page not found component too.
So, let’s create these router states now in the refactored app-routing.module.ts.
import { Routes } from '@angular/router';
import { ...