Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. user.promise.then(function(){
  2.                     wasUserLoaded = true;
  3.                     cleanUpDisableNavigationCallback();  // enable navigation
  4.  
  5.                     $rootScope.$on('$stateChangeStart', function(event, toState, toParams) {
  6.                         if (!user.current() || !user.current().id && _getInheritedProperty(toState, 'onlyAuthenticated')){
  7.                             // restrict access for anonymous users to special pages
  8.                             event.preventDefault();
  9.                             $state.go('probate.auth.login');
  10.                         }
  11.                     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement