Angular 2 - How to get the valid state of input with ngIf
<p>I am trying to wrap my head around this problem for some time now.</p>

<p>When I try to have an input in a form only if a condition is true, I receive an error, that invalid could not be read from undefined.</p>

<p>When using the elvis operator I don't get the error anymore, but even if the input is displayed, invalid &amp; dirty, I still don't see the error message.</p>

<pre><code>&lt;form #myForm="ngForm"&gt;
    ... other inputs ...

    &lt;input *ngIf="model.type === 'V'" 
        name="price"
        type="number"
        required
        [(ngModel)]="model.price"
        #price="ngModel"&gt;
    &lt;div class="errors" *ngIf="price?.invalid &amp;&amp; price?.dirty"&gt;
        Problem detected
    &lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>Anyone a hint what I am missing?</p>