app.directive('navMenu',[function(){ return { restrict: 'E', scope: { toggleMenu: '&', isActive: '&' }, templateUrl: 'app/views/nav-menu.html', controller: function($scope,$location){ $scope.isActive = function(linkPath){ if(linkPath == $location.path()){ return true; } else{ return false; } } } } }])