2017-10-06 211 views
-3

不插入值在离子3 不插入值以离子3不离子3

插入值到MySQL到MySQL到MySQL离子3不插入值不插入值到MySQL到在 离子3

 <ion-item *ngIf="selectedCities"> 
       <ion-label floating>Cities</ion-label> 
       <ion-icon name="ios-navigate" item-left></ion-icon> 
       <ion-select formControlName="city" [(ngModel)]="sCity"> 
       <ion-option [value]="sCity" *ngFor="let sCity of 
selectedCities">{{sCity.name}}</ion-option> 
       </ion-select> 
      </ion-item> 
+0

saveEntry(){ 令名:字符串= this.form.controls [ “名称”]值, 国家:字符串= this.form.controls [ “国家”]值, 状态:字符串=此.form.controls [“state”]。value, city:string = this.form.controls [“city”]。value, experience:string = this.form.controls [“experience”]。value console .log(“保存条目:”+名称,国家,州,市,经验) this.createEntry(姓名,国家,州,市,经验); } –

+0

它没有选择清单的价值。只显示“对象”... –

+1

把你的代码放在上面的问题中? – Sampath

回答

0

MySQL的我格式化得当:

saveEntry() { 
    let name: string = this.form.controls["name"].value, 
    country: string = this.form.controls["country"].value, 
    state: string = this.form.controls["state"].value, 
    city: string = this.form.controls["city"].value, 
    experience: string = this.form.controls["experience"].value 
    console.log("save Entry :"+ name, country, state, city, experience) 
    this.createEntry(name, country, state, city, experience); 
} 

难道改成这样:

saveEntry() { 
    let name: string = this.form.controls["name"].value; 
    let country: string = this.form.controls["country"].value; 
    let state: string = this.form.controls["state"].value; 
    let city: string = this.form.controls["city"].value; 
    let experience: string = this.form.controls["experience"].value; 

    console.log("save Entry :"+ name, country, state, city, experience); 

    this.createEntry(name, country, state, city, experience); 
} 

请使用;每个命令后。

什么是您的控制台日志显示? createEntry()是做什么的?

+0

添加';'它不工作。 –

+0

请显示'createEntry()'函数的代码。 –