HTML:-
<a ng-class="isAtive('/about')" href="/about">About</a>
Controller js:-
$scope.isAtive= function (path) {
return ($location.path() === path) ? 'active' : '';
}
With this the tasks link will have the active class in any url that starts with '/about'
<a ng-class="isAtive('/about')" href="/about">About</a>
Controller js:-
$scope.isAtive= function (path) {
return ($location.path() === path) ? 'active' : '';
}
With this the tasks link will have the active class in any url that starts with '/about'
0 comments:
Post a Comment