[Angular] 使用ngForTrackBy 來提升*ngFor的效能

 


詳細文章

https://dotblogs.com.tw/explooosion/2017/04/29/035512



用法

<li *ngFor="let item of items ; trackBy:trackByFn ; let i=index">{{i}} - {{ item.name }}</li>


trackByFn(index, item) { return index; // or item.name }







留言

這個網誌中的熱門文章

[Angular] 閒置登出作法

[Angular] 回到最上面 goTop按鈕作法

[SQL] 如何快速搜尋整個 SQL Server 資料庫中所有表格所有欄位中的所有資料