我采用了棱角分明4.3.3与JIT编译器和运行我的申请得到的错误如下:ngFor不工作
Property binding ngforOf not used by any directive on an embedded template.
Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations".
我已经确定导入BrowserModule
我主要的应用程序模块和我在我的子模块中导入了CommonModule
,该错误源于此。
下面是引发错误的模板:
<div class="background"></div>
<div class="content normal-page">
<ons-fab position="top right" ripple>+</ons-fab>
<ons-list>
<ons-list-item *ngFor="let item of items; let i = index">
<div class="center">
#{{i}} msg: {{item.msg}}
</div>
</ons-list-item>
</ons-list>
</div>
因为我输入正确的模块插入正确的地方这可能是造成这个错误?
您确定您的代码中没有'* ngfor'而不是'* ngFor'(大写'F')吗? –
我想出了问题,看到我的答案。这是一个webpack的问题。感谢您的帮助。 – Graham
我看到了,这就解释了为什么它们都被缩小了。 –