generator-ngstack
Version:
Based on DaftMonk generator-angular-fullstack, this is a custom mean stack yeoman generator
37 lines (25 loc) • 669 B
text/coffeescript
'use strict'
(->
### @ngInject ###
NavbarCtrl = ($location <% if(filters.auth) { %>, Auth <% } %>) ->
vm = @
vm.menu = [
title: 'Home'
link: '/'
]
vm.isCollapsed = true<% if(filters.auth) { %>
vm.isLoggedIn = Auth.isLoggedIn
vm.isAdmin = Auth.isAdmin
vm.getCurrentUser = Auth.getCurrentUser
vm.logout = ->
Auth.logout()
$location.path '/login'<% } %>
vm.isActive = (route) ->
route is $location.path()
return vm
NavbarCtrl
.$inject = ['$location'<% if (filters.auth) { %>,'Auth' <% } %>]
angular
.module '<%= scriptAppName %>'
.controller 'NavbarCtrl', NavbarCtrl
)()