首页 > 解决方案 > Angular *ngFor devmode TypeError: a[getSymbolIterator(...)]

问题描述

我在 Angular 6.1.7 上,当我*ngFor在调试模式下使用数组时,我一直有这个错误:

AddressEditComponent.html:36 ERROR TypeError: a[getSymbolIterator(...)] is not a function
    at areIterablesEqual (core.js:5492)
    at devModeEqual (core.js:5421)
    at checkBindingNoChanges (core.js:7689)
    at checkNoChangesNodeInline (core.js:10552)
    at checkNoChangesNode (core.js:10541)
    at debugCheckNoChangesNode (core.js:11144)
    at debugCheckDirectivesFn (core.js:11072)
    at Object.eval [as updateDirectives] (AddressEditComponent.html:37)
    at Object.debugUpdateDirectives [as updateDirectives] (core.js:11061)
    at checkNoChangesView (core.js:10440)

我的html很简单:

<select name="country" class="form-control"  [(ngModel)]="address.country" >
    <option value="">- Pays -</option>
    <option *ngFor="let country of countries" value={{country}}>
        {{country}}
    </option>
</select>

国家是['France','another','another...']

自从我使用它就停止生产enableProdMode();

有什么解决办法吗?

难道我做错了什么 ?

标签: angular

解决方案


更新到最新版本的angular时解决了


推荐阅读