December 2018
Intermediate to advanced
196 pages
4h 48m
English
Now that the application has several components to handle, we need some way of linking between them. To do this, we use the routerLink directive, which allows us to use regular <a> tags like usual, but also hooks in all the niceties from the router. Much like the href attribute, we pass the route we want to link to:
| | <a routerLink="edit/{{photo.id}}">Edit</a> |
The routerLink directive is not limited to just anchor tags—it can be attached to virtually any clickable element. Open search-header.component.html and add a routing bar with two routerLink attributes, which allow the user to navigate between the pages of this app.
| | <div class="container"> |
Read now
Unlock full access