angular - Reverse function strange behaviour when scroll
问题描述
I have this typescript code :
get history() {
return this.isCollapsed
? this.service.history.reverse().slice(0, this.SHOW)
: this.service.history.reverse();
}
In template :
<div *ngFor="let histor of history">
<div{{ histor.name }}</div>
</div>
</div>
The problem is that when I scroll these 2 items that exist in history
are changed with the place, and I get a kind of freezing. So strange behaviour. Is the reverse method the cause of that ? Thx in advance and sorry for my english.