title: Bind selected option from drop down to Typesscript object Angular 2
body: <p>I have a form where users can create Todo's. An <code>ITodo</code> has the following properties:</p>
  
  <pre><code>export interface ITodo {
      id: number;
      title: string;
      priority: ITodoPriority;
  }
  export interface ITodoPriority {
      id: number;
      name: string;
  }
  </code></pre>
  
  <p>So creating a Todo consists of setting the <code>title</code>-property and selecting a <code>priority</code> from a dropdown. The form looks like this:</p>
  
  <pre><code>&lt;form (submit)="saveTodo()"&gt;
      &lt;input type="text" [(ngModel)]="todo.title" /&gt;
      &lt;br /&gt;
      &lt;select (change)="setPriority($event.target.value)"&gt;
          &lt;option *ngFor="let priority of formModel.priorities" [value]="priority" [innerHtml]="priority.name"&gt;&lt;/option&gt;
      &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And my <code>Component</code>:</p>
  
  <pre><code>@Component({
      selector: "[todo-form]",
      templateUrl: "todo-form.view.html"
  })
  export class TodoFormComponent implements OnInit {
      private formModel: ITodoFormModel;
      private todo: ITodo = {
          id: -1,
          name: "",
          priority: null
      };
  
      ngOnInit() {
          //Retrieve formmodel, set in actual code
      }
  
      private setPriority(priority: any): void {
          this.todo.priority = priority; //This is where the problems is
      }
  }
  </code></pre>
  
  <p>The problem is in the function <code>setPriority</code> and specifically at the part where I try to set <code>this.todo.priority</code>. The value of the parameter <code>priority</code> is available but I'm unable to set it to <code>this.todo.priority</code>.
  What I have tried, and what does work is the following:</p>
  
  <pre><code>private setPriority(priority: any): void {
      let p: ITodoPriority = null;
      this.formModel.priorities.forEach(function (item) {
          if(priority == item) {
              p = item;
          }
      });
      this.todo.priority = p;
  }
  </code></pre>
  
  <p>So, this does work but it's a bit ugly and inefficient it seems.
  What would be the way to do this properly?</p>