123456789101112131415161718192021222324252627282930313233343536 |
- /**
- * Created by robin on 11/1/15.
- */
-
- angular.module('luticate')
- .controller('NavBarController', ['$scope', 'luticateAuthCache', 'luticateAuthUsers', '$state',
- function($scope, luticateAuthCache, luticateAuthUsers, $state) {
-
-
- $scope.logout = function()
- {
- var promiseLogout = {
- id: "promiseLogout",
- loaderGroups: ["body"]
- };
- luticateAuthUsers.logout(promiseLogout).finally(function()
- {
- $state.go('login');
- });
- };
-
- $scope.isLogged = function()
- {
- var user = luticateAuthCache.getUser();
- return user != null && user.Id != 0;
- };
-
- $scope.getUsername = function()
- {
- var user = luticateAuthCache.getUser();
- if (user != null) {
- return user.Username;
- }
- return "";
- }
- }]);
|