Skip to content

Add $stateChangeComplete event #1112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
donaldpipowitch opened this issue Jun 2, 2014 · 3 comments
Closed

Add $stateChangeComplete event #1112

donaldpipowitch opened this issue Jun 2, 2014 · 3 comments

Comments

@donaldpipowitch
Copy link

Small feature request: Could you add an $stateChangeComplete event, which is triggered after $stateChangeSuccess and $stateChangeError? Analogous to the promise API: then, catch and finally. Most APIs for async operations have a similar style.

Quick hack for now (in case anyone needs this):

angular.forEach([ '$stateChangeSuccess', '$stateChangeError'], function(event) {
  $rootScope.$on(event, function(event, toState, toParams, fromState, fromParams, error) {
    // do stuff here...
    // error param is undefined for $stateChangeSuccess
  });
});
@dotansimha
Copy link

Hi,
I've added this feature in the version that i forked.
Also, a pull request:
#1113

@donaldpipowitch
Copy link
Author

Great, thank you!

@eddiemonge
Copy link
Contributor

state events are going away in 1.0 so closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants