I wonder why the onEnter
function is not called, when changing from substate to parentstate? Is there any other function that gets called? I tried this:
$stateProvider.state('stateA', {
url: '/stateA',
views: {
'content': {
templateUrl: 'views/Aview.html',
controller: 'ControllerA'
},
'dialog': {
template: "<div ui-view='dialog'></div>"
}
},
onEnter: function ($state, olSelectInteractionService){
// IS NOT getting called
},
onExit: function (olSelectInteractionService){
}
});
$stateProvider.state('stateA.sub', {
url: '/sub/:id',
views: {
'dialog': {
templateUrl: 'views/Bview.html',
controller: 'ControllerB', // This Controller does something like $state.go("stateA");
resolve: {
ad: function (AdLoader, $stateParams) {
return AdLoader($stateParams.id);
}
}
}
}
});