Join Greg Bardwell for an in-depth discussion in this video Angular 4 routing introduction, part of Angular: Routing.
Put most simply, routing is the mapping of a URL segment to a component. On this screen, you'll see that a login segment of the URL loads in a login component as part of your screen. On this screen, the registration segment loads in the registration component. And it actually loads it into what we call a router outlet, and these are put within your application's HTML structure. And the router actually takes the path maps that you define with your application and routes them to that specific space on the screen for you.
Rural applications have many routes. And they also have hierarchy routes, this is child routes. Child routes allows you to group features together. For example, I might have an administrative section where only administration or super users get access to. And here I would have a list of my users. I would be able to edit the users. Maybe manage the companies, things like that. Another example is I might have a dashboard section. And I might have my user list as part of that dashboard section. So the user list in this case would be the child route.
Or the dashboard would be the parent route. And you can have arbitrarily deep child routes. Another important thing for routing is the ability to pass data, as I mentioned earlier, such as an e-commerce store. You would actually put the type of product you are using in the URL. And this has the benefits of being able to bookmark it or share it across the web via email or social media. Routes are also Angular's method of guarding access to specific segments of your application. We have things called route guards that control whether you can actually enter a route or enter a made feature set or even leave, such as if you didn't save your edits.
It also has really the great ability to allow us to lazy load parts of our application. This gives us the ability to launch our application very fast, make it very tight. Minimize or manage our bandwidth for mobile applications. Another great feature of Angular.