模板解析错误 - >无法绑定到'ngforOf',因为它不是'ion-item'的已知属性

我从web服务已经和我的html页面中获取数据我想呈现此数据。我用*ngfor遍历数据:模板解析错误 - >无法绑定到'ngforOf',因为它不是'ion-item'的已知属性

<ion-list> 

<ion-item *ngfor="let item of items">

{{item.Problem}}

</ion-item>

</ion-list>

,但它返回:

Uncaught Error: Template parse errors: 

Can't bind to 'ngforOf' since it isn't a known property of 'ion-item'.

1. If 'ion-item' is an Angular component and it has 'ngforOf' input, then verify that it is part of this module.

2. If 'ion-item' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("

<ion-list>

<ion-item [ERROR ->]*ngfor="let item of items">

{{item.Problem}}

"): ng:///AppModule/[email protected]:18

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". ("

<ion-list>

[ERROR ->]<ion-item *ngfor="let item of items">

{{item.Problem}}

"): ng:///AppModule/[email protected]:8

我查了ngfor语法已经,如何解决这个问题?

回答:

应该*ngFor

<ion-item *ngFor="let item of items"> 

以上是 模板解析错误 - &gt;无法绑定到'ngforOf',因为它不是'ion-item'的已知属性 的全部内容, 来源链接: utcz.com/qa/260646.html

回到顶部