You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngRepeat pass collection to transcluded scope #8282
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:
var updateScope = function(scope, index, collection) {
scope.$collection = collection;
...
};
// then at line 364 and 377
updateScope(block.scope, index, collection);
I could probably run up a PR at some point if this is acceptable?
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.
Activity
caitp commentedon Jul 21, 2014
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.
jeffbcross commentedon Jul 21, 2014
I believe we landed on:
item in items | filter:'foo' as results track by $index
caitp commentedon Jul 21, 2014
was there ever an issue # opened about that? it would be good to attach this issue to it
SimeonC commentedon Jul 21, 2014
Cool, look forward to using it. Thanks for the quick reply.
jeffbcross commentedon Jul 21, 2014
Not sure if it's documented, but I think @matsko is the one working on it
matsko commentedon Jul 22, 2014
Here's the PR: #8046
matsko commentedon Jul 22, 2014
Merged. The feature is now in master as: