Hi
I have this page.html:
<form #form="ngForm" (ngSubmit)="submit(form.value)" class="list">
<ion-list>
<ion-item>
<ion-label fixed>SSID</ion-label>
<ion-input name="ssid" type="text" [(ngModel)]="currentSSID"></ion-input>
</ion-item>
<ion-item>
<ion-label fixed>Password</ion-label>
<ion-input name="passwd" ngModel type="password"></ion-input>
</ion-item>
<ion-item>
<ion-label>SSID Hidden?</ion-label>
<ion-select name="notHidden" ngModel>
<ion-option value="NO">NO</ion-option>
<ion-option value="YES">YES</ion-option>
</ion-select>
</ion-item>
<ion-item>
<button ion-button type="submit" block>Add Device
<ion-icon name="md-add"></ion-icon>
</button>
</ion-item>
</ion-list>
</form>
And in my ts file I have this:
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { LoadingController } from 'ionic-angular';
declare var WifiWizard;
@Component({
selector: 'page-add-device',
templateUrl: 'add-device.html'
})
export class AddDevicePage {
value: any;
currentSSID: string;
constructor(public navCtrl: NavController, public navParams: NavParams , public loadingCtrl: LoadingController, public platform:Platform) {
WifiWizard.getCurrentSSID(this.ssidHandler, this.fail);
}
ssidHandler(s) {
alert(s)
this.currentSSID=s;
}
fail(e){
alert("Please connect to your local WIFI ");
}
}
I really cant figure out why isn’t the this.currentSSID=s putting the ssid value in the input field…
If I go and place this: this.currentSSID=‘testing 123’ in the beginning of the constructor it is binding to the ssid input field.