Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angular resolver for cookie

angular.module('MyApp', [])
.run(function($rootScope, myLoginService) {
$rootScope.$on('$routeChangeStart', function () {
  if (!myLoginService.isUserLoggedIn()) {
    $location.path('/login');
  }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #resolver #cookie
ADD COMMENT
Topic
Name
3+9 =