title: Typescript error Property does not exist on type
body: <p>I am new to angularjs 2 and ionic 2. I am working with angularjs form with Validators, FormControl and FormGroup. Everything is good when I execute the project using ionic serve --lab. but when I build that project it gives <strong>error: Property 'username' does not exist on type.</strong></p>
  
  <p><strong>login.ts</strong></p>
  
  <pre><code>import { Component } from '@angular/core';
  
  import { LoadingController, NavController } from 'ionic-angular';
  
  import { AuthService } from '../../service/authService';
  
  import {Validators, FormBuilder, FormGroup, FormControl } from '@angular/forms';
  
  @Component({
    selector: 'page-login',
    templateUrl: 'login.html'
  })
  export class LoginPage {
  
    user: any;
  
    submitAttempt: boolean = false;
  
    slideTwoForm : FormGroup;
  
    constructor(public navCtrl: NavController, 
                public authService: AuthService,
                public loadingCtrl: LoadingController, 
                private formBuilder: FormBuilder) {
  
      this.slideTwoForm = formBuilder.group({
        username: ['', Validators.compose([Validators.minLength(5),          Validators.required])],
        description: ['', Validators.required],
        age: ['']
      });
    }
  
    logForm() {
      if (!this.slideTwoForm.valid) {
        this.submitAttempt = true;
      }
    }
  
  }
  </code></pre>
  
  <p><strong>login.html</strong></p>
  
  <pre><code>&lt;ion-content padding&gt;
      &lt;form [formGroup]="slideTwoForm" (ngSubmit)="logForm()" novalidate&gt;
          &lt;ion-item&gt;
              &lt;ion-label floating&gt;Username&lt;/ion-label&gt;
              &lt;ion-input #username formControlName="username" type="text"&gt;&lt;/ion-input&gt;
          &lt;/ion-item&gt;
          &lt;ion-item *ngIf="!slideTwoForm.controls.username.valid  &amp;&amp; submitAttempt"&gt;
              &lt;p&gt;Please enter a valid name.&lt;/p&gt;
          &lt;/ion-item&gt;
          &lt;ion-item&gt;
            &lt;ion-label&gt;Description&lt;/ion-label&gt;
            &lt;ion-textarea formControlName="description"&gt;&lt;/ion-textarea&gt;
          &lt;/ion-item&gt;
          &lt;ion-item&gt;
              &lt;ion-label floating&gt;Age&lt;/ion-label&gt;
              &lt;ion-input formControlName="age" type="number"&gt;&lt;/ion-input&gt;
          &lt;/ion-item&gt;
          &lt;ion-item *ngIf="!slideTwoForm.controls.age.valid  &amp;&amp; submitAttempt"&gt;
              &lt;p&gt;Please enter a valid age.&lt;/p&gt;
          &lt;/ion-item&gt;
          &lt;button ion-button type="submit"&gt;Submit&lt;/button&gt;
      &lt;/form&gt;
  &lt;/ion-content&gt;
  </code></pre>
  
  <p>Everything is fine until I run <strong>ionic build android</strong> command to generate apk file.<br>
  Can someone please tell me why I am receiving these errors?</p>
  
  <p>I also refers this link: <a href="https://stackoverflow.com/questions/40147102/property-does-not-exist-on-type-typescript">Property does not exist on type. TypeScript</a> but it can't help me: </p>