$stateChangeStart run before getting data from Rest API
问题 I'm tried to do user login authentication, I've made a service named AuthService with a method isAuthenticated in which I make a call to API to cross check the user is logged in or not (Also I'll user the user role in it later), and then I call this service in $rootScope.$on but its not wait until my service get data from API, Here is my app.js var app = angular.module('myApp', ['ngRoute', 'ui.router', 'ngAnimate', 'toaster', 'ui.bootstrap']); app.config(['$routeProvider', '$locationProvider'