gpt4 book ai didi

angular - ionic 2 ngFor ionic 选项抛出错误

转载 作者:太空狗 更新时间:2023-10-29 18:20:40 25 4
gpt4 key购买 nike

我在模板中有简单的 ionic 选择

<ion-select class="pull-right" [(ngModel)]="selectedLanguage">
<ion-option *ngFor="lang of languages" [value]="lang.name">{{lang.name}}</ion-option>
</ion-select>

但是它的抛出错误:

Unhandled Promise rejection: Template parse errors: Can't bind to 'ngFor' since it isn't a known property of 'ion-option'. 1. If 'ion-option' is an Angular component and it has 'ngFor' input, then verify that it is part of this module. 2. If 'ion-option' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("0>

有人知道代码有什么问题吗?

最佳答案

let 关键字如下图所示,

*ngFor="let lang of languages"

关于angular - ionic 2 ngFor ionic 选项抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41919449/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com