title: Angular 9 Select Binding to Model
body: <p>before i start I have tried the following</p>
  <p><a href="https://www.angularjswiki.com/angular/how-to-bind-a-select-element-to-object-in-angular/" rel="nofollow noreferrer">https://www.angularjswiki.com/angular/how-to-bind-a-select-element-to-object-in-angular/</a>
  <a href="https://www.codeproject.com/Questions/1278097/How-do-you-get-the-value-of-the-selected-option-in" rel="nofollow noreferrer">https://www.codeproject.com/Questions/1278097/How-do-you-get-the-value-of-the-selected-option-in</a>
  <a href="https://stackoverflow.com/questions/51839685/associate-select-value-to-ngmodel-in-angular-4">Associate select value to ngModel in Angular 4</a>
  <a href="https://stackoverflow.com/questions/43311162/how-to-assign-selected-value-to-select-when-value-is-of-class-object-in-angula#_=">How to assign selected value to &quot;Select&quot; when value is of class object in angular 2</a>_
  <a href="https://docs.angularjs.org/api/ng/directive/select" rel="nofollow noreferrer">https://docs.angularjs.org/api/ng/directive/select</a></p>
  <p>something so easy to do in PHP has taken me 8 hours and I am still not even close. I do not understand what I am doing wrong here?</p>
  <p>TS file</p>
  <pre><code>shopstates: any = {};
  selectedObject: any;
  this.shopstates = [
        { statename: 'Australian Capital Territory', statecode: 'ACT' },
        { statename: 'New South Wales', statecode: 'NSW' },
        { statename: 'South Australia', statecode: 'SA' },
        { statename: 'Queensland', statecode: 'QLD' }
   ];
  </code></pre>
  <p>component html file</p>
  <pre><code>&lt;select [(ngModel)]=&quot;selectedObject&quot; class=&quot;form-control&quot; (change)=consoleLog()&gt;
      &lt;option *ngFor=&quot;let state of shopstates&quot; [ngValue]=&quot;state&quot;&gt;{{ state.statename }} ({{ state.statecode }})&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  <p>Selected State is {{ selectedObject.state }}</p>
  <p>this is very frustrating. I'm about to make a change to try and pass the value to the TS file but I don't want to do this and 2. don't know how to pass the value anyway</p>
  <p>Any direction or help is appreciated</p>