In Angular Router is like an object that can be used in our app component to describe the routes we want to use.
In Angular, there are three components that can be used to configure routing:
* Routes: It describes routes of the application
* RouterOutlet: It is a “placeholder” component that gets expanded to each route’s content
* RouterLink: It is used to get link to the routes
It's important to see here that our routes serve as the argument to RouterModule.forRoot(). By putting RouterModule in our imports, we ensure the utilization of the RouterOutlet and RouterLink components in this module.
The RouterOutlet directive tells router where to render the content in the view.
For example, if we have a view:
Stuff in the outer template here
For navigating between routes, we need to use RouterLink directive. For example, if we want to perform the task of linking to our login and dashboard page from a navigation, it becomes possible to change our view something like showed below.