Dynamically Adding Route Components
Rather than define each route's component separately, use RouterOutlet
which serves as a component placeholder; Angular dynamically adds the component for the route being activated into the <router-outlet></router-outlet>
element.
In the above example, the component corresponding to the route specified will be placed after the <router-outlet></router-outlet>
element when the link is clicked.
Last updated