This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ng-repeat track by $index with custom directive #16332
Closed
Description
I'm submitting a ...
- bug report
- feature request
- other
Current behavior:
After filtering and array that is being repeated and has a custom directive in each repeated element that has an isolated scope. The custom directive is not reinitiated.
I assume this is expected behaviour but can be confusing and should be made clearer as to what putting track by $index
can do to your custom directives.
Expected / new behavior:
NA
Minimal reproduction of the problem with instructions:
- create ng repeat with a custom directive inside (include track by $index)
- using $filter on the repeat array filter the array and you will notice the data in the directive will not reflect the new filtered array
AngularJS version: 1.5.10
Browser: all
Anything else:
Could the docs be made more clear between the what Angular is doing when using track by
and that using $index
with custom directives is not going to work.
Check my response here for a break down of the issue
https://stackoverflow.com/a/47310734/2536454