text: (function() {
      'use strict';
  
      angular
          .module('<%=angularAppName%>')
          .controller('NavbarController', NavbarController);
  
      NavbarController.$inject = ['$location', '$state', 'Auth', 'Principal', 'ENV', 'LoginService'];
  
      function NavbarController ($location, $state, Auth, Principal, ENV, LoginService) {
          var vm = this;
  
          vm.isNavbarCollapsed = false;
          vm.isAuthenticated = Principal.isAuthenticated;
          vm.inProduction = ENV === 'prod';
          vm.login = login;
          vm.logout = logout;
          vm.toggleNavbar = toggleNavbar;
          vm.collapseNavbar = collapseNavbar;
          vm.$state = $state;
  
          function login () {
              collapseNavbar();
              LoginService.open();
          }
  
          function logout () {
              collapseNavbar();
              Auth.logout();
              $state.go('home');
          }
  
          function toggleNavbar () {
              vm.isNavbarCollapsed = !vm.isNavbarCollapsed;
          }
  
          function collapseNavbar () {
              vm.isNavbarCollapsed = true;
          }
      }
  })();
  