generator-ngfs
Version:
Yeoman generator for creating MEAN stack applications, using MongoDB, Express, AngularJS, and Node
24 lines (22 loc) • 592 B
JavaScript
module('<%= scriptAppName %>')
.controller('NavbarCtrl', function ($scope, $location<% if(mongoPassportUser) { %>, Auth<% } %>) {
$scope.menu = [{
'title': 'Home',
'link': '/'
}<% if(mongoPassportUser) { %>, {
'title': 'Settings',
'link': '/settings'
}<% } %>];
<% if(mongoPassportUser) { %>
$scope.logout = function() {
Auth.logout()
.then(function() {
$location.path('/login');
});
};
<% } %>
$scope.isActive = function(route) {
return route === $location.path();
};
});
;
angular.