Route configuration:
$stateProvider.state('root', {
url: "/",
template: '<div ui-view></div>'
})
.state('root.child',{
url: '/child',
templateUrl: 'some.html'
controller: function(){
console.log('child')
}
});
StateChangeStart listener:
$scope.$on('$stateChangeStart', function (event, state, params, fromState, fromParams) {
console.log('state change start');
}
});
When I navigate to state 'root.child', first 'state change start' is printed on console and then 'child' is printed. But when I refresh the page while in child state or directly hit the url '/child', first 'child' is printed and then 'state change start' is printed. Please help.