title: How to get index of selected option in Angular
body: <p>I am trying to get the selected option <strong><em>index</em></strong> of a <code>select</code> using Angular. I am using Angular (4) and Ionic 3. </p>
  
  <p>My template looks like below:</p>
  
  <pre><code>&lt;ion-select [(ngModel)]="obj.city"&gt;
     &lt;ion-option *ngFor="let city of cities; let i = index;" 
                  [value]="city"  [selected]="i == 0"&gt;
                  {{city.name}}
     &lt;/ion-option&gt;
  &lt;/ion-select&gt;
  </code></pre>
  
  <p>I want the index of selected city to be accessed in Component code. Lets say, I want that index to be assigned to a variable <code>selectedCityIndex</code> in component.</p>
  
  <p>My current code is pre selecting the first option as default. Solution should not break this functionality.</p>
  
  <p>I am searching for a solution which do not include interating the array (i.e. no loop in JavaScript part). It should not use "indexOf" method or document's methods like "document.getElementById". I am not using jQuery.  </p>