-
Notifications
You must be signed in to change notification settings - Fork 212
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
$inject function handlers #337
Labels
Comments
@joeljeske Could you make a PR? |
Sure, just confirming it aligned with your interests. |
joeljeske
pushed a commit
to joeljeske/angular-permission
that referenced
this issue
Oct 12, 2016
joeljeske
pushed a commit
to joeljeske/angular-permission
that referenced
this issue
Oct 12, 2016
masterspambot
added a commit
that referenced
this issue
Oct 19, 2016
#337 Support injectable function handlers
Released in v4.1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be very useful for function handlers to be injected instead of called directly. Especially when the functions need to be used in a provider context, it makes using services awkward.
Usage Examples:
Usage in Permission defintion
Usage in State definition
To make backwards compatible, you could detect if the function is setup for
strictDi
(either being an array with trailing function value, or a function with a$inject
property) and either invoke directly or through the $injector. This would just enforce that injected functions must be strictly invoked.The text was updated successfully, but these errors were encountered: