首页 > 解决方案 > 重复字体真棒图标导致潜在的角度内存不足崩溃[不是特定于浏览器]

问题描述

我在 ngFor 循环中使用 font-awesome 5 图标,当我从服务器接收到大量数据时,浏览器会暂停。如果我不在循环中使用 font-awesome 图标,一切正常。如何使用图标并避免潜在的内存不足崩溃?问题在所有非 chrome 特定的浏览器上仍然存在。请检查下面的图片是否有错误。

在此处输入图像描述

代码:

      <tr *ngFor="let data of someList|  orderBy: {property: column, direction: direction}; let $index= index" (click)="takeMesomeWhere(data.number, data.cafe)">

      <td>{{ data.number }}</td>
      <td>{{data.cafe}}</td>
      <td>{{data.itemDes}}</td>
      <td class="text-center align-middle cursor-pointer" style="color:red">
        <i class="fas fa-times" aria-hidden="true"></i>
      </td>
      // if I remove the above td element, which contains font-awesome icons, everything works fine
     </tr>

标签: javascriptangulartypescript

解决方案


推荐阅读