title: Template Driven form Cannot read property 'required' of null-Angular 6
body: <p>Am working on angular 6 with template driven form.Face some issue on validation</p>
  
  <p>html code</p>
  
  <pre><code>             &lt;div class="form-group"&gt;
  
                          &lt;div class="form-group"&gt;
                              &lt;input type="text" class="form-control" placeholder="Name" name="name"
                                  required [(ngModel)]="configuration.name" #name="ngModel"
                                  minlength="2"&gt;
                              &lt;span *ngIf="submitted &amp;&amp; name.errors['required']" class="text-danger"&gt;Please
                                  Enter Name&lt;/span&gt;
  
  
                          &lt;/div&gt;
                          &lt;div class="modal-footer"&gt;
                  &lt;button type="button" class="btn btn-outline-dark" (click)=" sav(form)"&gt;Save&lt;/button&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>when i click on save button without any input its showing validation message,after that i type some values in that input text field it showing an error</p>
  
  <p>am also tried name.errors.required and  name.errors?.required both are failed</p>
  
  <p><a href="https://i.stack.imgur.com/B826q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B826q.png" alt="enter image description here"></a></p>