Summary
That's a lot of information! So let's recap.
First, we established that the primary job of the router is to manage navigation. And there are two ways to do it: imperatively, by calling router.navigate
, or declaratively, by using the RouterLink directive. We learned about the difference between router.navigateByUrl
and router.navigate:
one takes the whole URL, and the other one takes a patch it applies to the current URL. Then we talked about absolute and relative navigation. Finally, we saw how to use [routerLink]
and [routerLinkActive]
to set up navigation in the template.