ng-repeat with filters that introduce new collections #2302
Description
There is a thorough discussion including analysis, ideas, and fiddles here (concluding with some successful work-arounds):
https://groups.google.com/forum/#!msg/angular/IEIQok-YkpU/oKuLvzCnAcoJ
A common instigating use-case is chunking arrays for grids:
I believe the issue can be summarized as difficulty using ng-repeat with filters that change the collection's reference...? Brainstorming possible directions forward:
-
Would
track by
61f2767 syntax make it possible to use filters that subsequently change the collection reference? It seems to metrack by
and this issue have nothing to do with each other ultimately. -
Could/should this issue by resolved by new additions to angular's destructing syntax? i.e.
row in items chunk by 6
Seems to me to be too specific a feature to make part of the destructing syntax.
-
An angular $service that supports creating filters that modifier collection reference within
ng-repeat
. So thatchunk
or any other filter could be confidently applied tong-repeat
:What users are rolling on their own: http://jsfiddle.net/pkozlowski_opensource/zvpVg/2/