I am using the following code:
<li class="sidebar-list-item"><a ng-class="getClass('/dashboardHome')" href="/dashboardHome" class="sidebar-link text-muted"><i class="o-home-1 mr-3 text-gray"></i><span>Home</span></a></li>
$scope.getClass = function (path) {
console.log("Path: "+path);
return ($location.path().substr(0, path.length) === path) ? 'active' : '';
}
On console I am getting : Path: /dashboardHome
But not its not working.