【发布时间】:2018-12-08 06:54:09
【问题描述】:
我对 IONIC 应用程序开发比较陌生。 现在我面临一个问题,我需要发送从 MySQL PHP 动态生成的多个输入字段。 即,我有一个输入字段,我可以对其进行更新并发送到我要求的服务器。
现在我可以从我的服务器获取数据并生成输入字段。但是我无法通过单击按钮将(如果有的话更新)发送回服务器
<ion-list>
<ion-item no-margin="">
<ion-grid>
<strong><ion-row>
<ion-col>Student code</ion-col>
<ion-col>name</ion-col>
<ion-col>phone</ion-col>
</ion-row>
</strong>
</ion-grid>
</ion-item>
<ion-grid>
<ion-row *ngFor="let student of students">
<ion-col >{{student.student_code}}</ion-col>
<ion-col>{{student.full_name}}</ion-col>
<ion-col ion-item=""><ion-input maxlength="10" required [(ngModel)]="student.phone"></ion-input></ion-col>
</ion-row>
</ion-grid>
</ion-list>
这是 .ts 文件
loadStudents(division){
this.rest.loadStudents(division)
.subscribe(data=>{
this.students=data;
},error1 => {
console.log(error1);
});
}
【问题讨论】:
标签: javascript php angular ionic-framework