I've added this to my side navigation's controller:
if($location.path() == '/goals') {
$scope.goals_active = true;
}
This works perfectly fine and applies the active class with ng-class
.
However, the problem I am now running into is with an id.
i.e. /goals/b2dcf461-56f6-f812-bed0-538e1603a595
How can I tell my application, in Angular (and using $location if necessary), to not only set $scope.goals_active
to true
when the path is /goals
, but also /goals/:id
?
I need some kind of a *
operator but don't know how this is possible.