You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

toolbar.controller.js 937B

12345678910111213141516171819202122232425262728
  1. /**
  2. * Created by robin on 11/1/15.
  3. */
  4. angular.module('app')
  5. .controller('ToolBarController', ['$scope', '$state', '$mdSidenav', 'luticateAuthCache', 'luticateAuthUsers',
  6. function($scope, $state, $mdSidenav, luticateAuthCache, luticateAuthUsers) {
  7. $scope.toggleSideBar = function()
  8. {
  9. $mdSidenav('left').toggle();
  10. };
  11. $scope.getCurrentUser = function () {
  12. return luticateAuthCache.getUser();
  13. };
  14. $scope.isLogged = function () {
  15. return $scope.getCurrentUser() != null;
  16. };
  17. $scope.logout = function () {
  18. luticateAuthUsers.logout().then(function(data)
  19. {
  20. $state.go("images");
  21. });
  22. }
  23. }]);