title: How to dynamically add formGroup to a template driven form in angular4?
body: <p>i am using template driven form, as per functionality i have to toggle the controls on user interaction.
  <strong>problem</strong></p>
  
  <p>initially all my controls gets initialized to the form but when during toggle i have to hide one control and display another. how can i register the newly added formGroup to the form.</p>
  
  <p>i tried this, but it is not working</p>
  
  <pre><code>this.form.controls.addControl('formGroup_VIN', []);
  </code></pre>
  
  <p><strong>note</strong>: it is an requirement, that i have to use template driven form</p>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>suppose if i have something like this</p>
  
  <pre><code>&lt;div *ngIf="vehicle.show"&gt;
   &lt;input [id]="saId" [name]="saId"&gt;
  &lt;/div&gt;
  
  &lt;div *ngIf="!vehicle.show"&gt;
   &lt;input [id]="saId" [name]="saId"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and on click of a button, i show and hide the form control, now my question is, how will i register the newly added control to the form?</p>