This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngRepeat pass collection to transcluded scope #8282
Comments
Something like this has been discussed quite a bit during the meeting today, I can't remember which syntax we decided on, but I believe we'll be adding an alias to the processed (or not) collection with an arbitrary name. The meeting notes should have details soon. |
I believe we landed on: |
was there ever an issue # opened about that? it would be good to attach this issue to it |
Cool, look forward to using it. Thanks for the quick reply. |
Not sure if it's documented, but I think @matsko is the one working on it |
Here's the PR: #8046 |
Merged. The feature is now in master as: <!-- `results` can be called anything -->
<div ng-repeat="item in items | filter:x as results">...<div> |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In the case of filtered ng-repeats (
ng-repeat="type in types | filter: search"
) it would be really useful to add something like$collection
to the transcluded scope at line L276.Then we could easily access the filtered collection in our ng-clicks and ng-class functions like we access
$index
.I imagine it would be changed like the following which wouldn't incur much overhead as it is just passing an object reference:
I could probably run up a PR at some point if this is acceptable?
The text was updated successfully, but these errors were encountered: