1
検証を実行するイオンフォームでランタイムエラーが発生します。私は各入力コントロールに名前属性を追加するという戦略を試みましたが、エラーが発生しました。イオン入力名属性がngFormで認識されない
未知(未定):エラー:ngModelがフォームタグ内で使用されている場合は、name属性を設定する必要があります。 ..
似たようなコードでも同様のコードが働いていました。だれかが私のエラーを見つけられますか?
<ion-header>
<ion-navbar>
<ion-title>{{ enquiry.name || 'New Enquiry'}}</ion-title>
<ion-buttons end>
<button ion-button icon-only (click)="onSave()">
<ion-icon name="checkmark"></ion-icon>
</button>
</ion-buttons>
</ion-navbar>
</ion-header>
<ion-content padding>
<form #formValues="ngForm">
<ion-list>
<ion-item>
<ion-label stacked>Date</ion-label>
<ion-datetime [(ngModel)]="enquiry.date" name="date"></ion-datetime>
</ion-item>
<ion-item>
<ion-label stacked>Name</ion-label>
<ion-input type="text" [(ngModel)]="enquiry.name" name="name"></ion-input>
</ion-item>
<ion-item>
<ion-label stacked>Phone</ion-label>
<ion-input type="text" [(ngModel)]="enquiry.phone" name="phone"></ion-input>
</ion-item>
<ion-item>
<ion-label stacked>Type</ion-label>
<ion-select [(ngModel)]="enquiry.type">
<ion-option *ngFor="let type of types" name="type">{{type}}</ion-option>
</ion-select>
</ion-item>
<ion-item>
<ion-label stacked>Budget</ion-label>
<ion-input type="number" [(ngModel)]="enquiry.budget" name="budget"></ion-input>
</ion-item>
</ion-list>
</form>
</ion-content>
ありがとう、ベガ、良い点。いつものように、私は夢のように感じる! – user1608405
あまりにも多くの画面時間、我々はすべてそれを持って、悪くはない落ちた:) – Vega