Skip to content

trackBy doesn't work as expected #257

Description

@WuglyakBolgoink

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:
image

after click on refresh button:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions