title: Angular 2 Select - set default value in select
body: <p>I currently have this code which loops through and array making each <code>optgroup</code>, then loops through nested arrays, making each <code>option</code> and account type.  I am trying to set the default value of the select to the first account type of the first nested array with this code: </p>
  
  <pre><code>&lt;select class="q-select"
          ngModel
          name="answerForQuestion{{ question?.questionId }}"&gt;
      &lt;optgroup label="{{subCat?.subCat}}"
          *ngFor="let subCat of accountTypes; let i = index;"&gt;
          &lt;option *ngFor="let acctType of subCat.accountTypes; let j = index;"
                  [ngValue]="acctType"
                  [selected]="i == 0 &amp;&amp; j == 0"&gt;
                      {{ acctType?.displayName }}
          &lt;/option&gt;
      &lt;/optgroup&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I am using <code>[selected]="i == 0 &amp;&amp; j == 0"</code> to set the default selected to the first account type in the first nested array but for some reason this is not working.  </p>
  
  <p>I appreciate any help on how to fix this.</p>
  
  <p>Also, I do not want to use two way binding with [(ngModel)].</p>
  
  <p>Thanks</p>