Hallo!
| if(Array.isArray(propertyNames)){ |
| |
| cacheKey=propertyNames.join("->"); |
| |
| // Ensure cached identity function. |
| if(!cache[cacheKey]){ |
| |
| cache[cacheKey]=functiontrackByProperty<T>(index: number,item: T) : any{ |
| |
| varvalues=[]; |
| |
| // Collect the item values that will be aggregated in the resultant |
| // item identity |
| for(varpropertyNameofpropertyNames){ |
| |
| values.push(item[propertyName]); |
| |
| } |
| |
| return(values.join("->")); |
| |
| }; |
| |
| } |
This part for a list of properties doesn't work correctly.
the list will be re'rendered each time if I click on refresh button with the same data. If I move the code into separate function and use directly on trackBy, then the list will be never re'rendered...
any Idea?
Outputs:
on start:

after click on refresh button:

Hallo!
JavaScript-Demos/demos/ng-for-track-by-pipe2-angular7/app/track-by-property.pipe.ts
Lines 37 to 60 in fa6730f
This part for a list of properties doesn't work correctly.
the list will be re'rendered each time if I click on refresh button with the same data. If I move the code into separate function and use directly on trackBy, then the list will be never re'rendered...
any Idea?
Outputs:
on start:

after click on refresh button:
