Angular navigation is configured using the routerLink
directive. The routerLink directive behaves like an href’s you are familiar with, but it hooks into Angular’s router to navigate between your defined routes.
[00:00] To create some navigation, I am going into my app component, where the router outlet is in my template. I'll just say SomeNav. I'll create a tag, and instead of href, I am going to use a directive called RouterLink. This RouterLink is going to be empty because that one's going to point to home, when I click on this.
[00:18] The second one, not href but RouterLink, is going to point to contacts, so this one will load contacts. Just format this a little bit and hit save. You'll see how the navigation of home, contacts, home, contacts change in the URL, and load in those individual modules.
Member comments are a way for members to communicate, interact, and ask questions about a lesson.
The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io
Be on-Topic
Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.
Avoid meta-discussion
Code Problems?
Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context
Details and Context
Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!