title: formGroup.get vs formGroup.controls in reactive form - Angular
body: <p>Is there any preferred way when selecting validation using</p>
  
  <ul>
  <li><code>myForm.controls['name'].valid</code></li>
  <li><code>myForm.get('name').valid</code></li>
  </ul>
  
  <p>as both seems to be only syntactically different but achieving the same goal.</p>
  
  <pre><code>&lt;label&gt;Name
    &lt;input type="text" formControlName="name"&gt;
  &lt;/label&gt;
  &lt;div class="alert" *ngIf="!myForm.controls['name'].valid &amp;&amp; myForm.controls['name'].touched"&gt;
    {{ titleAlert }}
  &lt;/div&gt;
  </code></pre>
  
  <p>Same as</p>
  
  <pre><code>&lt;div class="alert" *ngIf="!myForm.get('name').valid &amp;&amp; myForm.get('name').touched"&gt;
    {{ titleAlert }}
  &lt;/div&gt;
  </code></pre>
  
  <p>From what I checked in the code, <code>get</code> has this code:</p>
  
  <pre><code>AbstractControl.prototype.get = function (path) { return _find(this, path, '.'); };
  </code></pre>
  
  <p>I have just started Angular, so an expert opinion would be appreciated.</p>