title: Error 1068: Property does not exist on type angular 2 (AOT)
body: <blockquote>
  <p>I am new in angular 2, i am making a &quot;User Register&quot; form but it shows error in &quot;Property does not exist on type&quot; in Phone number Validation.</p>
  <p>I am compiling in JIT and AOT.</p>
  <p>In JIT compiler shows error message and run my user register form it is working properly. but when i compile with AOT shows compilation error.</p>
  <p>I am reading the angular 2 form validation official doc here is the link <a href="https://angular.io/docs/ts/latest/cookbook/form-validation.html#!#template1" rel="nofollow noreferrer">Angular 2 form validation</a></p>
  <p>Below is my Html Form and compiler Output</p>
  </blockquote>
  <p><strong>Html Form</strong></p>
  <pre><code>&lt;form class=&quot;ui large form&quot; method=&quot;post&quot; (ngSubmit)=&quot;onSubmit(registerForm.form.valid)&quot; #registerForm=&quot;ngForm&quot; novalidate&gt;
          &lt;sm-loader [complete]=&quot;!formSubmited&quot; class=&quot;inverted&quot; text=&quot;Loading...&quot;&gt;&lt;/sm-loader&gt;
          &lt;div class=&quot;form-group&quot;&gt;
              &lt;div class=&quot;col-md-12 img-bottom&quot;&gt;
                  &lt;div class=&quot;col-md-offset-4&quot;&gt;
                      &lt;img (click)=&quot;profileImage.click()&quot; class=&quot;img img-responsive img-circle ui middle aligned tiny circular image profileImage&quot;
                          [src]=&quot;profileImageSrc&quot; /&gt;
                      &lt;input class=&quot;form-control user-reg-img&quot; (change)=&quot;fileChangeEvent($event)&quot; type=&quot;file&quot; accept=&quot;image/*&quot; #profileImage [hidden]=&quot;true&quot;
                      /&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;col-md-12 image-padding&quot;&gt;
                      &lt;span class=&quot;user-reg-img-name&quot; (click)=&quot;profileImage.click()&quot;&gt;{{profileImageName}}&lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class=&quot;form-group&quot;&gt;
              &lt;label&gt;&lt;strong&gt;Signup with Email Address:&lt;/strong&gt;&lt;/label&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;form-group&quot;&gt;
              &lt;p class=&quot;success text-center&quot;&gt;{{successMessage}}&lt;/p&gt;
              &lt;p class=&quot;error text-center&quot;&gt;{{errorMessage}}&lt;/p&gt;
              &lt;div class=&quot;field&quot;&gt;
                  &lt;input type=&quot;text&quot; name=&quot;name&quot; placeholder=&quot;Name&quot; [(ngModel)]=&quot;register.name&quot; #name=&quot;ngModel&quot; required class=&quot;form-control input-reg&quot;
                  /&gt;
                  &lt;div [hidden]=&quot;name.valid || name.pristine&quot; class=&quot;error text-left&quot;&gt;
                      Name is required
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;form-group&quot;&gt;
              &lt;div class=&quot;field&quot;&gt;
                  &lt;input class=&quot;form-control input-reg&quot; type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Email&quot; [(ngModel)]=&quot;register.email&quot; #email=&quot;ngModel&quot;
                      required /&gt;
                  &lt;div [hidden]=&quot;email.valid || email.pristine&quot; class=&quot;error text-left&quot;&gt;
                      Email is required
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
  
          &lt;div class=&quot;form-group&quot;&gt;
              &lt;input type=&quot;text&quot; id=&quot;mobile&quot; class=&quot;form-control  input-reg&quot; required minlength=&quot;10&quot; maxlength=&quot;10&quot; name=&quot;mobile&quot; [(ngModel)]=&quot;register.mobile&quot;
                  placeholder=&quot;Phone Number&quot; #mobile=&quot;ngModel&quot; pattern=&quot;[0-9]+&quot;&gt;
              &lt;div *ngIf=&quot;mobile.errors &amp;&amp; (mobile.dirty || mobile.touched)&quot;&gt;
                  &lt;div class=&quot;error text-left&quot; [hidden]=&quot;!mobile.errors.required&quot;&gt;
                      Mobile Number is required
                  &lt;/div&gt;
                  &lt;div class=&quot;error text-left&quot; [hidden]=&quot;!mobile.errors.minlength&quot;&gt;
                      Mobile Number must be at least 10 characters long.
                  &lt;/div&gt;
                  &lt;div class=&quot;error text-left&quot; [hidden]=&quot;!mobile.errors.maxlength&quot;&gt;
                      Monile Number cannot be more than 10 characters long.
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;form-group&quot;&gt;
              &lt;div class=&quot;field&quot;&gt;
                  &lt;input class=&quot;form-control input-reg&quot; type=&quot;password&quot; name=&quot;password&quot; placeholder=&quot;Password&quot; [(ngModel)]=&quot;register.password&quot;
                      #password=&quot;ngModel&quot; required /&gt;
                  &lt;div [hidden]=&quot;password.valid || password.pristine&quot; class=&quot;error text-left&quot;&gt;
                      Password is required
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;form-group&quot;&gt;
              &lt;input type=&quot;checkbox&quot; name=&quot;isAgree&quot; [(ngModel)]=&quot;register.isAgree&quot; #isAgree=&quot;ngModel&quot; required /&gt;
              &lt;label id=&quot;label-terms-cond&quot;&gt;I Agree to Post Bucks &lt;a href=&quot;#&quot;&gt;Terms &amp; Conditions&lt;/a&gt;&lt;/label&gt;
              &lt;div [hidden]=&quot;!showTermsAgreeErrorMsg&quot; class=&quot;error text-left&quot;&gt;
                  Please agree the terms and conditions to continue
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;form-group&quot;&gt;
              &lt;textarea rows=&quot;4&quot; class=&quot;form-control font-small terms-cond-textarea&quot; rows=&quot;7&quot;&gt;You must follow any policies made available to you within the Services.&lt;/textarea&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;form-group&quot;&gt;
              &lt;button class=&quot;fluid yellow large ui button btn btn-block btn-warning reg-btn-submit&quot; type=&quot;submit&quot;&gt;Signup&lt;/button&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  <p><strong>AOT Output</strong></p>
  <p><a href="https://i.stack.imgur.com/FRFFI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FRFFI.png" alt="AOT error" /></a></p>
  <p>Thanks in advance</p>
  <p>Vikram</p>