Angular 模板分析错误->;Can';t绑定到';ngforOf';因为它不是';t'的已知属性;离子项目';
我已经从web服务中获取了数据,我想在html页面中呈现这些数据。我使用Angular 模板分析错误->;Can';t绑定到';ngforOf';因为它不是';t'的已知属性;离子项目';,angular,ionic-framework,Angular,Ionic Framework,我已经从web服务中获取了数据,我想在html页面中呈现这些数据。我使用*ngfor循环浏览数据: <ion-list> <ion-item *ngfor="let item of items"> {{item.Problem}} </ion-item> </ion-list> {{item.Problem} 但它返回的是: Uncaught Error: Template parse errors: Can'
*ngfor
循环浏览数据:
<ion-list>
<ion-item *ngfor="let item of items">
{{item.Problem}}
</ion-item>
</ion-list>
{{item.Problem}
但它返回的是:
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/RedditsPage.html@14: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/RedditsPage.html@14:8
未捕获错误:模板分析错误:
无法绑定到“ngforOf”,因为它不是“离子项”的已知属性。
1.如果“离子项目”是一个角度组件,并且具有“ngforOf”输入,则验证它是否是该模块的一部分。
2.如果“ion item”是Web组件,则将“CUSTOM_ELEMENTS_SCHEMA”添加到此组件的“@NgModule.schemas”以抑制此消息。
3.若要允许任何属性,请将“无错误模式”添加到此组件的“@NgModule.schemas”。("
]*ngfor=“让项目中的项目”大于
{{item.Problem}
“”:ng:///AppModule/RedditsPage。html@14:18
嵌入模板上的任何指令都不使用属性绑定。确保属性名称拼写正确,并且所有指令都列在“@NgModule.declarations”中。("
[错误->]
{{item.Problem}
“”:ng:///AppModule/RedditsPage。html@14:8
我已经检查了ngfor语法,如何解决这个问题?应该是
*ngfor
<ion-item *ngFor="let item of items">