The RouterLinkActive is a directive used to toggle CSS classes for active RouterLink bindings based on the current RouterState. i.e., the Router will add CSS classes when this link is active and remove them when the link is inactive.
For example, you can add them to RouterLinks as follows:
- <h1>Angular Router</h1>
- <nav>
- <a routerLink="/todosList" routerLinkActive="active">List of todos</a>
- <a routerLink="/completed" routerLinkActive="active">Completed todos</a>
- </nav>
- <router-outlet></router-outlet>