title: How to get control type in template driven form in Angular 4
body: <p>I have a form in angular 4 component. The fields are generated dynamically, i.e., using ngFor to generate the inputs. The inputs are of different types, e.g. checkbox, text...</p>
  
  <p>In the ts code, how can i know the type of the input control?</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;form *ngIf="active" #easyForm="ngForm" (ngSubmit)="onSubmit()"&gt;
    &lt;div *ngFor="let i in items"&gt;
      &lt;input type="text" name="text-{{item.id}}" [(ngModel)]="item.text"&gt;
      &lt;input type="checkbox" name="checkbox-{{item.id}} (ngModel)]="item.checked"&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>TS</p>
  
  <pre><code>@ViewChild('easyForm') set content(easyForm: NgForm) {
  this.easyForm = easyForm;
  if (this.easyForm) {
    const keys = Object.keys(this.easyForm.controls);
    foreach(let key in keys) {
       this.easyForm.controls[key] &lt;---- am i able to get the type of the control here?
    }
  }
  </code></pre>