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

What is current ability to DI in Transition Hooks? #2854

Closed
martypdx opened this issue Jul 5, 2016 · 2 comments
Closed

What is current ability to DI in Transition Hooks? #2854

martypdx opened this issue Jul 5, 2016 · 2 comments

Comments

@martypdx
Copy link

martypdx commented Jul 5, 2016

Using "angular-ui-router": "^1.0.0-beta.1" it doesn't seem possible to dependency inject:

    $transitionsProvider.onStart({
        to: state => !!( state.data && state.data.requiresAuth )
    }, function(UserService){
        // UserService is always transition :(
    });

Given this line in looks like it's hard coded to only supply the transition (and the state context is null). I saw in some of the other issues that hook may be changing to supply $inject?

Is there work around? Should I just wait for next release? :)

@christopherthielen
Copy link
Contributor

@martypdx
Copy link
Author

martypdx commented Jul 6, 2016

Thanks @christopherthielen!

@martypdx martypdx closed this as completed Jul 6, 2016
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

2 participants