-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat(ngRepeat): provide support for aliasing filtered repeater results as a scope member #8046
Conversation
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
I am trying to understand why this feature is needed. What is wrong with |
I wasn't aware of that trick, but I don't know if that would be considered stable. I'll send out an email to ask about this. |
For what it's worth I've been using an 'as' filter to accomplish this:
I've found this to be useful because I can get a snapshot of the data anywhere along the filter chain:
not the worlds best example but you get the idea. |
@lgalfaso I just talked with @IgorMinar and the assignment operator will likely be removed from Angular down the road. |
lgtm @kevinjamesus86 suggestion is interesting but the syntax is not developer friendly |
Just an idea: if this was a function of the filter instead of ng-repeat, you could handle sub-results like @kevinjamesus86 showed, and ng-repeat wouldn't be so bloated |
Ah, was not aware that the assignment operator was going to be removed. In that case LGTM |
The assignment operator is not going to be removed, that would be complete nonsense. At this point it just doesn't make any sense to do that in 1.x |
@Narretz interesting idea, but with the exception of ngRepeat in what other scenarios would this be useful? |
…s as a scope member ngRepeat can now alias the snapshot of the list of items evaluated after all filters have been applied as a property on the scope. Prior to this fix, when a filter is applied on a repeater, there is no way to trigger an event when the repeater renders zero results. Closes angular#5919 Closes angular#8046
ngRepeat can now alias the snapshot of the list of items evaluated after all filters have
been applied as a property on the scope. Prior to this fix, when a filter is applied on a
repeater, there is no way to trigger an event when the repeater renders zero results.
Closes #5919