top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

What is the use for RoluterLinkActive in Angular Routes (2,4,5) ?

0 votes
52 views
What is the use for RoluterLinkActive in Angular Routes (2,4,5) ?
posted Dec 16, 2017 by Manish Tiwari

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

In Angular(2/4/5), Router Link Active is used to identify whether a route is active or not. Based on this we can control the CSS class

Example:

<ul class="nav navbar-nav">
  <li><a routerLink="/" routerLinkActive="menu-active">Home</a></li>
  <li><a routerLink="/about" routerLinkActive="menu-active" >About</a></li>
  <li><a routerLink="/contact" routerLinkActive="menu-active" >Contact</a></li>
</ul>

In Above example will add the menu-active class if the route found in routerLink matches the current route.

answer Dec 26, 2017 by Madhavi Latha
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...