how do return the $state.current.name from ui-router statechange
问题 I would like to return the .state('name') when I change location in angular. From my run() it can return the $state object: .run(function($rootScope, Analytics, $location, $stateParams, $state) { console.log($state); but when I try to get $state.current it is empty object .run(function($rootScope, $location, $stateParams, $state) { console.log($state.current); config example: .config(function($stateProvider, $urlRouterProvider, AnalyticsProvider) { $urlRouterProvider.otherwise('/');