title: How to get color on dropdown of select on Angular 8?
body: <p>I have tried to get color on dropdown of select according to the value that user has selected.
  The code I have tried is:</p>
  
  <p>App.component.ts</p>
  
  <pre><code>
  @Component({
    selector: 'my-app',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent {
  
    selectedColor = '';
  
    colors = [
      {
        name: 'yellow',
        value: '#ffff00'
      },
      {
        name: 'red',
        value: '#ff3300'
      },
      {
        name: 'blue',
        value: '#0000ff'
      }
    ];
  
    onChange(value){
      this.selectedColor = value;
    }
  }
  </code></pre>
  
  <p>App.component.html</p>
  
  <pre><code>&lt;select [(ngModel)]="selected" [compareWith]="compareObjects" [ngStyle]="{'background-color': selected.color}"&gt;
    &lt;option *ngFor="let color of colors" [ngStyle]="{'background-color': color.value}" [ngValue]="datas"&gt;{{color.name}}&lt;/option&gt;
   &lt;/select&gt;
  </code></pre>
  
  <p>But It is getting my requirement only on Windows but not on mac. Any idea what to do?</p>