title: angular 4 ERROR TypeError: Cannot read property 'dirty' of undefined
body: <p>I am new to angular, I met such problem:</p>
  
  <p>When I put an ngIf in the element,</p>
  
  <pre><code> &lt;input type="text" *ngIf="true" id="name" name="name" class="form-control" required [(ngModel)]="name" #name="ngModel" /&gt;
  aaaaaa {{name.dirty}}
  </code></pre>
  
  <p>I got </p>
  
  <pre><code>ERROR TypeError: Cannot read property 'dirty' of undefined
  at Object.eval [as updateRenderer] (PrepareInvestmentComponent.html:1)
  at Object.debugUpdateRenderer [as updateRenderer] (core.es5.js:13105)
  at checkAndUpdateView (core.es5.js:12256)
  at callViewAction (core.es5.js:12599)
  at execComponentViewsAction (core.es5.js:12531)
  at checkAndUpdateView (core.es5.js:12257)
  at callViewAction (core.es5.js:12599)
  at execEmbeddedViewsAction (core.es5.js:12557)
  at checkAndUpdateView (core.es5.js:12252)
  at callViewAction (core.es5.js:12599)
  </code></pre>
  
  <p>But, when I remove the ngIf, it works fine.
  Can I know why and any sign to fix this issue?</p>