【发布时间】:2021-10-24 23:25:03
【问题描述】:
我的 html 模态组件中有以下代码:
<ng-container *ngFor="let school of schools">
{{school.name}}
<ng-container>
但是我收到以下错误:
“Can't bind to 'ngForOf' since it isn't a known property of 'ng-container'
我在网上看了其他人的解决方案,建议导入表单模块、反应表单模块和通用模块,但我已经在模态模块中导入了这些
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { CommonModule } from "@angular/common";
有没有人对我如何摆脱这个错误有任何其他建议?
【问题讨论】: