title: Ionic 2 get ion-input value
body: <p>I am creating a login with ionic 2. Please don't just answer "you just need to add the [(ngModules)]-attribute". If you think, this is the solution, please explain it why. Explain it, like you would do it to a child.</p>
  
  <p>My Code in <strong>login.ts</strong>:</p>
  
  <pre><code> import {Component} from '@angular/core';
   import {IonicPage, NavController, NavParams, MenuController} from 'ionic-angular';
  
  @IonicPage()
  @Component({
    selector: 'page-login',
    templateUrl: 'login.html',
  })
  export class LoginPage {
    password: string;
  
    constructor(public navCtrl: NavController, public navParams: NavParams, public menu: MenuController) {
      this.menu.enable(false, "");
    }
  
    login() {
      alert(this.password);
    }
  
    ionViewDidLoad() {
      console.log('ionViewDidLoad LoginPage');
    }
  }
  </code></pre>
  
  <p>The Code in <strong>login.html</strong></p>
  
  <pre><code>&lt;ion-content padding id="login-dialog"&gt;
    &lt;ion-list inset&gt;
  
      &lt;ion-item no-padding&gt;
        &lt;ion-label color="primary"&gt;
          &lt;ion-icon name="person"&gt;&lt;/ion-icon&gt;
        &lt;/ion-label&gt;
        &lt;ion-input type="text" placeholder="Username"&gt;&lt;/ion-input&gt;
      &lt;/ion-item&gt;
  
      &lt;ion-item no-padding&gt;
        &lt;ion-label color="primary"&gt;
          &lt;ion-icon name="lock"&gt;&lt;/ion-icon&gt;
        &lt;/ion-label&gt;
        &lt;ion-input type="password" placeholder="Password"&gt;&lt;/ion-input&gt;
      &lt;/ion-item&gt;
      &lt;button ion-button full color="primary" (click)="login()"&gt;Login&lt;/button&gt;
  
    &lt;/ion-list&gt;
  
  &lt;/ion-content&gt;
  </code></pre>