-
Notifications
You must be signed in to change notification settings - Fork 3k
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
isState filter needs to be marked as stateful (introduced in AngularJS 1.3.0-rc.2, affects all newer versions as well) #1479
Comments
Thanks. We've discussed deprecating and removing these filters. Do you use them? Would you be terribly offended if we made you implement them in your own codebase? |
I do use isState but no I wouldn't be offended by its removal. I use it because I'd rather use existing functionality but at one point I'd already written this wrapper (and attached it to the scope) before being aware of its existence. Exposing this functionality as a filter is somewhat odd and only necessitated by there being no way to inject services into the markup. |
@christopherthielen Yeah, the more I think about it, the more I feel like filters are just not the right fit for what we're doing with them. I reiterate my +1 for deprecation, and upgrade it to suggesting that we just remove them outright. I don't know that there's a way we can fix this barring seriously core surgery. |
"fix" would be marking them as stateful, which I think we should do for 0.2.x then remove them in 1.0
|
Ah, okay. Didn't realize that was an option. Good plan. |
For anyone who is encountering this, you can workaround by setting $stateful in a decorator:
|
Due to this change in AngularJS,
angular/angular.js@fca6be7
Which assumes that filters are stateless or purely functional unless specifically marked as stateful, watch expressions that use isState filter, which is of course stateful, do not update unless input values change, even if the state has changed.
I assume the same applies to includedByState filter as well, though I have not used it.
The text was updated successfully, but these errors were encountered: