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

on-watch rule triggers on return #519

Open
CxRes opened this issue Dec 11, 2017 · 0 comments
Open

on-watch rule triggers on return #519

CxRes opened this issue Dec 11, 2017 · 0 comments

Comments

@CxRes
Copy link

CxRes commented Dec 11, 2017

return statement must be treated equivalent to an assignment for the purpose of the on-watch rule.

My use case involves returning a function that ends with return $rootScope.$on(...) from a service into a controller. I can use the return value with the '$destroy' event. I know the workaround is to place $rootscope.$on() in the controller but with my method I can avoid a $rootScope DI in the controller.

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

No branches or pull requests

2 participants