我採用了棱角分明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
我看到了,這就解釋了爲什麼它們都被縮小了。 –