title: Angular 2 select option (dropdown) - how to get the value on change so it can be used in a function?
body: <p>I am trying to build a drop down with a few values.</p>
  
  <p>However, on selecting a value, I want to make an API call that takes an id.</p>
  
  <p>In my component.ts, I have an array of values:</p>
  
  <pre><code>values = [
    { id: 3432, name: "Recent" },
    { id: 3442, name: "Most Popular" },
    { id: 3352, name: "Rating" }
  ];
  </code></pre>
  
  <p>In my template, I am using that array as follows:</p>
  
  <pre><code>&lt;select&gt;
    &lt;option *ngFor="let v of values" [value]="v"&gt;  
      {{v.name}}
    &lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>However, on picking a value from the drop down, how can I access the <code>id</code> property?  I want to use that in my function <code>getPhotosByType(id)</code>.</p>
  
  <p>Thanks</p>