【发布时间】:2021-01-24 09:41:55
【问题描述】:
当我尝试在 angular 10 ionic 中使用 模板驱动 方法来访问在页面加载时出现错误的模型。
现在我已经在 HTML 页面中使用了这种方法。
<form (ngSubmit)="onBookPlace()" #f="ngForm">
<ion-grid>
<ion-row>
<ion-col size-sm="6" offset-sm="3">
<ion-item>
<ion-label position="floating">First Name</ion-label>
<ion-text type="text" name="firstname" ngModel required></ion-text>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<ion-col size-sm="6" offset-sm="3">
<ion-item>
<ion-label position="floating">Last Name</ion-label>
<ion-text type="text" name="lastname" ngModel required></ion-text>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</form>
我在这里错过了什么..?
更新 1:
它也在这里说明
https://codecraft.tv/courses/angular/forms/template-driven/
【问题讨论】:
标签: angular ionic-framework ionic5 angular10 angular-template-form