Directives
Setup
Before we start using routeshub directives, we need to import the navigation module to get access.
Import example:
Navigation
Routeshub provides a directive navLink
for navigation reasons. It extends by routerLink
and doing the same as routerLink
. But if you replace routerLink
with navLink
, then and want to pass parameters, don't forget to use navParams
. navLink
manages dynamic paths (parameters) with the additional attribute navParams
.
Usage example:
As you could see, we can pass in the navLink
route's state or it also possible to omit the state, and then navLink
itself will still handle the link.
Summing navLink
works in the same way as routerLink
. It consumes the string or array of strings. But first and foremost, this directive was created for navigation through route states and support dynamic parameters via states.
Active Link
Because we replaced routerLink with navLink, then we need another directive to manage active links. Routeshub has navLinkActive
for these reasons