html - How to keep a link active after refreshing page using angularjs? -
<ul class="nav navbar-nav"> <li ng-class="{ active: isactive('/dashboards/{{dashboard.id}}/dashboard')}" style="border-right: #ececec 1px solid; display: block;" dir-paginate="dashboard in dashboards | itemsperpage:itemsize" data-match-route="/dashboards/{{dashboard.id}}"> <a ng-href="#/dashboards/{{dashboard.id}}/dashboard"> {{ dashboard.name }} </a> </li> </ul>
i created nav bar number of links, wanted current link stay active after reloading page, how can that?
you can add 1 variable make false default. whenever u click on other links make true. in ng-class put 1 condition if false add active class
Comments
Post a Comment