Skip to content

Add $stateChangeComplete event #1112

@donaldpipowitch

Description

@donaldpipowitch

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
  });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions