53 questions
2 votes
1 answer
60 views
Angular ngModelChange data inconsistency
Facing an issue where a key has same value in another object in an array of objects. When ngModelChange is trigerred for 2nd one the data obtained in the ts file is of first one. I have data as ...
0 votes
1 answer
225 views
Multiple *ngFor trackBy functions in the same component
I added some trackBy functions on *ngFor directives of an Angular project in order to boost performances. There is one component with 2 lists of items. The trackBy function is the same for both lists ...
1 vote
3 answers
2k views
Browser freezes when using mat-select with ngFor without trackBy
TL;DR: I already have working solutions, but I would like explanations why mat-select behaves like this. While building an application with Angular Material I run into this error when using mat-select ...
0 votes
1 answer
218 views
ngFor trackBy is not identifying items correctly using ngModel
I will be brief. Here's the problem on stackblitz: trackByBugntfree\ Explanation: Resources contain ppermission that are displayed on screen with checkboxes.\ Objective: When a "permission" ...
0 votes
1 answer
249 views
Angular polling trackBy doesn't trigger ngDestroy but the component is updated
In this example https://stackblitz.com/edit/angular-ivy-hptdnu?file=src%2Fapp%2Fgrid%2Fgrid.component.html without trackBy the ngOnDestroy hook is triggered and the data updated I can understand it ...
0 votes
0 answers
1k views
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[]...
0 votes
1 answer
410 views
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, ...
0 votes
1 answer
749 views
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 <div *ngFor="let friend of friends$ | async;trackBy:trackByFn"> <img [...
5 votes
1 answer
3k views
Angular trackBy not working in nested *ngFor
My component is some what like <div class="users-list" *ngIf="datasetPermission !== undefined"> <div *ngFor="let userpermission of datasetPermission; trackBy : trackByFn"> <...
2 votes
2 answers
844 views
Ng-repeat one-time binding and "track by" change
Our web app uses ngRepeat to display a list of items. The array and its objects are never changed, but values of the objects inside can be modified by the user. We generate a unique trackId's for ...
0 votes
2 answers
90 views
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. <tr ng-...
0 votes
1 answer
941 views
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 ...
3 votes
2 answers
4k views
sorting an *ngFor array with trackBy in Angular 4
i'm having trouble sorting and array that has a trackBy function. The use case is as follows: I have an item array. All these items have a z-index property. I also have a layer manager that can edit ...
8 votes
1 answer
8k views
Angular - What is the point of implementing trackBy?
Since recently, the Angular styleguide-lint-extender "Codelyzer" is throwing warnings when you do not have a trackBy-function implemented on every *ngFor. I am wondering why this is considered an ...
0 votes
1 answer
183 views
Track by is not working with ng-repeat and ng-value
// this.data = [{value: 'damon'}]; // this.dataOrf = [{value: 'damon'}, {value: 'mean'}] <md-select multiple ng-model="$ctrl.data" aria-label="data"> <md-option ng-value="opt" ng-repeat="...