Open Jinoooo opened 9 years ago
@Jinoooo yes could you please create pen it will be use to debug
Here is the pen. http://codepen.io/Jinooo/pen/wKYZZq/?editors=101 If you search for James, avatar shows: WI (the previous ion-item at index 0 for William). I noticed it happens only if you add track by $index to the ng-repeat directive.
@Jinoooo thanks for codepen. gone through the issue looks like its the compiler issue on directive i.e. on data filed value changes directive need to be re-compiled to update the isolated scope. is this issue is blocking? re-compiling the directive on each data change will not be good idea anyway i will do more research on how to resolve. for your reference see similar thread in angularjs forum https://github.com/angular/angular.js/issues/7119
Not sure how the other directive are handing this scenario very nicely, like ng-repeat. This is an expected behaviour from any directive to react upon change. The interesting part is the fact that if you remove the track by $index, it works just fine, which is puzzling. i.e why it reacts with changes without being re-compiled !?
track by $index is having issue. track by user.name works perfectly i.e
If a filter added to the list, the filtered list won't have the correct avatar, but the old avatar based on the previous $index. tried to $observe the attribute for change and re-generate the imageTag, with no luck. If needed I can create a pen for demo.