Questions tagged [angularjs-track-by]

51 questions
0
votes
0 answers

Angular ngFor rerender trackBy when changing the array position

I want the ngFor not to re-render when the id change the index/position on the array. The trackBy method not working as I expected in this situation. Consider code below, In the TS File users: User[]; constructor() { this.change1(); } …
oz1985oz
  • 397
  • 1
  • 8
0
votes
1 answer

Angular trackBy giving Missing Properties Error

I am using track by function in my ionic angular app and while building the app, it gives me error: Type '(index: any, item: any) => any' is missing the following properties from type 'any[]': pop, push, concat, join, and 25 more. I am using this…
Kartik Solanki
  • 161
  • 1
  • 10
0
votes
1 answer

How to use trackBy on AsyncPipe with images rendering, it re- renders page every time?

My question is how to use trackby on Async pipe with images rendering under it. I have done following. in html
and in my…
Ranjeet Avghad
  • 387
  • 1
  • 12
0
votes
2 answers

AngularJS: How do I animate the text if $index changes?

I have an app in angularjs which uses $interval() in background and requests datas form the database via PHP every seconds. I then use track by $index which really helps on performance.
DuliNini
  • 181
  • 2
  • 14
0
votes
1 answer

Ionic virtualScroll does not refresh after list order change

Using Ionic3 and virtualScroll works fine when I sort the list in the constructor but when I use a sort button on my page to change the sort order of the list, the sort is done but the list is not refreshed. I've seen virtualTrackBy but I'm not sure…
0
votes
1 answer

Track by is not working with ng-repeat and ng-value

// this.data = [{value: 'damon'}]; // this.dataOrf = [{value: 'damon'}, {value: 'mean'}]
Deamon
  • 109
  • 3
  • 10
0
votes
2 answers

Duplicate ng-repeat with track by

How to allow duplicate in ng-repeat with track by and update ng-repeat list from controller ? By using track by $index i am not able to update scope variable, but i want to allow duplicate object in ng-repeat Condition : 1) allow duplicate in…
Rohit
  • 1
  • 1
0
votes
1 answer

Angular Materials md-select and trackBy allowing options to be selected

I'm trying to customise this Angular Material example code (https://material.angularjs.org/latest/api/directive/mdSelect) to my needs. I have three groups of select options. If an option is selected in a group, it should unselect all options in…
0
votes
2 answers

Angular 2 *ngfor doesn't update with sequential http request responses

I have an empty array, called rows and I want to display it with *ngFor. On each row of the array I pass the response from an http request. All the http requests are called sequentially. Even though the array is fed correctly, the *ngFor is never…
dimitris maf
  • 671
  • 8
  • 17
0
votes
1 answer

Catch duplicates and ignore them inside ng-repeat's track by without a filter (AngularJS)

I'm having some issues using ng-repeat with track by because sometimes duplicate data comes in (same user) because the user was pushed down in the date ordered list (API side) after a newer entry has been pushed to the beginning of the array. I…
0
votes
2 answers

Angular v1.4 repeat a div without re-rendering already rendered items

I wrote code to repeat an image array and a load more button to ajax request and push response images in that array. But every time new response comes then whole images reshuffled.
Moshi
  • 1,385
  • 2
  • 17
  • 36
0
votes
1 answer

angular select 'track by' resets selected

I'm struggling getting "selected" to work with 'track by' for Angular select element. I have the following select:
0
votes
1 answer

DOM keeps being rebuilding with angular-selectize ng-repeat and track by

I'm using AngularJS with the angular-selectize module. To populate the page with the elements I need I use something like this: index.html