I need a callback when state.go has been invoked successfully, and set my alert message. Currently the message is pushed to the array, after state.go has been called. State.go c
You may use state change listener.
$rootScope
.$on('$stateChangeSuccess',
function (event, toState, toParams, fromState, fromParams) {
//show alert()
});
See State Change Events.
$state.go()
returns a promise.
So do something like:
$state.go('wherever', {whenever: 'whatever'}).then(function() {
// Get in a spaceship and fly to Jupiter, or whatever your callback does.
});