Hi,
I’m using ionic-angular@2.0.0-beta.11, and i’m having trouble getting two-way binding working with <ion-input>. However, if I replace it with html <input>, then two-way binding works just fine.
I have not tested it with any previous beta versions of ionic 2. So, I can’t confirm if it worked with the previous versions.
Here is my code -
home.html
<ion-header>
<ion-navbar>
<ion-title>
Home
</ion-title>
</ion-navbar>
</ion-header>
<ion-content class="home" padding>
<ion-item>
<ion-label primary floating>Name</ion-label>
<ion-input [(ngModel)]="name"></ion-input>
</ion-item>
<ion-label>Hello {{name}}!</ion-label>
<button (click)="showName()">Click Me</button>
</ion-content>
home.ts
import {Component} from "@angular/core";
import {AlertController} from 'ionic-angular';
@Component({
template: require("./home.html")
})
export class HomePage {
name: string;
constructor(private alertController: AlertController) {
}
showName() {
console.log(this.name);
let alert = this.alertController.create({
title: 'Hello ' + this.name + '!',
buttons: ['OK']
});
alert.present();
}
}
When I input text in <ion-input> field, {{name}} in <ion-label> shows nothing. Also, after inputing text, when I click on button, console log prints undefined for this.name and alert shows nothing too.
I’m using ionic 2 in a desktop app written using electron framework. Would that make any difference? One another issue I noticed was with floating label, floating animation never works!! You can find my code at - https://github.com/ssreekanth/electron-ionic2-webpack-starter
Please correct me if I’m doing it wrong. But, this has been bugging me for a while. Any help will be much appreciated!
Thank you
Sreekanth

Thank you very much in advance!!