【问题标题】:IE11 showing <!--bindings={ "ng-reflect-ng-for-of": "" }--> Error for *ngForIE11 显示 <!--bindings={ "ng-reflect-ng-for-of": "" }--> *ngFor 错误
【发布时间】:2019-07-24 05:36:28
【问题描述】:

我正在尝试使用表 tr td 遍历 *ngFor。*ngFor 在 IE 浏览器中显示空数据。但是在 chrome 中可以正常工作。

一段代码:

<tbody>
                    <tr *ngFor="let item of files; let indx= index">
                        <td><strong>{{ item.name }}</strong></td>
                        <th class="text-center">
                            <mat-icon (click)="removeFile(indx)">delete</mat-icon>
                            <!-- <mat-icon>get_app</mat-icon> -->
                        </th>
                    </tr>
                </tbody>

【问题讨论】:

  • 有人能回答这个吗??
  • 这是一段没有渲染的代码吗?其他组件在 IE 中是否正常工作?
  • 是的。其他组件正常渲染。只有这个不渲染

标签: angular7


【解决方案1】:

Error for *ngFor' title='IE11 showing Error for *ngFor'>Okay,尝试改变表结构

<table>
  <thead>
     <th> <mat-icon (click)="removeFile(indx)">delete</mat-icon></th>
  </thead>
  <tbody>
        <tr *ngFor="let item of files">
         <td><strong>{{ item.name }}</strong></td>
         </tr>
  </tbody>
</table>

【讨论】:

  • 好的.. 检查你的 polyfills.ts 文件,我添加了 polyfills 文件的图像,你的文件应该是这样的。
猜你喜欢
  • 2019-05-22
  • 1970-01-01
  • 2016-09-03
  • 2021-06-25
  • 1970-01-01
  • 1970-01-01
  • 2018-08-01
  • 2017-04-01
  • 1970-01-01
相关资源
最近更新 更多