2017-10-06 204 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()'函數的代碼。 –