Nav apraksta

logout.js 272B

123456789
  1. angular.module('MyApp')
  2. .controller('LogoutCtrl', function($location, $auth, toastr) {
  3. if (!$auth.isAuthenticated()) { return; }
  4. $auth.logout()
  5. .then(function() {
  6. toastr.info('You have been logged out');
  7. $location.path('/');
  8. });
  9. });