I want to show/hide a div with a navbar inside of it. Whenever the URL has /profile in it i want it to show the navbar. At this moment I have this:
JS
app.controller('MainCtrl',['$scope', '$location', function($scope, $location) {
$scope.isActive = function(viewLocation) {
return viewLocation === $location.path();
};
$scope.$location = $location;
}]);
HTML
<div ng-show="isActive('/profile')" ng-controller="MainCtrl">
At this point it only shows the div when its :
www.randomwensite.com/profile
But when i go a page further its gone.
I want it showing whenever the whole URL contains /profile.
Like this: www.randomwebsite.com/profile/shop/edit
or: www.randomwebsite.com/profile/account
Any idea how I would be able to get that done?