Skip to content
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

Pass in transition to HookMatchCriteria #255

Conversation

jutaz
Copy link
Contributor

@jutaz jutaz commented Sep 26, 2018

This allows the matcher functions to access the raw transition object. Doing so unlocks a bit more flexibility, as some of the matching could be performed using the transition object. For example:

$transitions.onBefore({
  from: (state, transition) => state.self.name === '' || transition.options().reload
}, (transition) => {
  //...
});

The above will run only when coming from the root state (i.e. initial page load), or (and that's not possible today) if the {reload: true} option was used when navigating to a state.

@christopherthielen
Copy link
Member

nice work. we'll need to update docs for the public apis before publishing this

@jutaz
Copy link
Contributor Author

jutaz commented Sep 26, 2018

nice work. we'll need to update docs for the public apis before publishing this

I’ll update the docs tomorrow then. Thanks!

@jutaz
Copy link
Contributor Author

jutaz commented Oct 15, 2018

Bumping @christopherthielen - anything else I'd need to add to get this merged?

@christopherthielen christopherthielen merged commit 926705e into ui-router:master Oct 18, 2018
@christopherthielen
Copy link
Member

thank you @jutaz !

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

Successfully merging this pull request may close these issues.

2 participants