title: Selecting input type based on drop down selection in Angular 2
body: <pre><code>&lt;select class="select-sm form-control staffPatient" [(ngModel)]="personType"&gt;
                               &lt;option value="staff" selected="true"&gt;Staff&lt;/option&gt;
                               &lt;option value="patient"&gt;Patient&lt;/option&gt;
                              &lt;/select&gt;
  </code></pre>
  
  <p>Based on the selection I need to display the fields.  </p>
  
  <p>If it's staff, this will display</p>
  
  <pre><code> &lt;p-autoComplete [hidden]="personType != staff" [(ngModel)]="val" [suggestions]="staffInfoList" field="perscode" field="personName" [minLength]=4 
                                      (onSelect)="setPersonInvolved($event)"  
                                      (completeMethod)="getPersonalMast($event)" [ngModelOptions]="{standalone: true}"&gt;&lt;/p-autoComplete&gt;
  </code></pre>
  
  <p>If it's patient this will show</p>
  
  <pre><code> &lt;input [hidden]="personType != patient" type="text" required="" class="form-control search" (keyup.enter)="getPatientInfo($event)" &gt;
  </code></pre>
  
  <p>Have written the code [hidden] but not working.
  2. Tried selected="true" to make staff as default in dropdown but in that drop down default is coming empty</p>