2017-01-29 3 views
2

У меня есть простой ион-выбери в шаблоне, какионного 2 ngFor на ионном вариант метания ошибки

<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>

Кто-нибудь есть идея, что не так с кодом?

ответ

3

let ключевое слово отсутствует, как показано ниже,

*ngFor="let lang of languages" 
+1

Спасибо! Теперь работает – Amal

Смежные вопросы