title: Angular: set selected value for <select>
body: <p>I have data set for my <code>&lt;select&gt;</code> loaded asynchronously. I use hot observable, as the data can change in time. The problem is I am unable to set selected value and also Angular does not point to first element by itself (there is no value set until user does it). I'm trying to subscribe to my own observable and... it doesn't work, I wonder why? How can I solve this problem?</p>
  
  <p>PLNKR: <a href="https://plnkr.co/edit/uDmTSHq4naYGUjjhEe5Q" rel="nofollow noreferrer">https://plnkr.co/edit/uDmTSHq4naYGUjjhEe5Q</a></p>
  
  <pre><code>@Component({
    selector: 'my-app',
    template: `
      &lt;div&gt;
        &lt;h2&gt;Hello {{name}}&lt;/h2&gt;
      &lt;/div&gt;
      &lt;select [(ngModel)]="selectedValue"&gt;
        &lt;option *ngFor="let value of (values$ | async)"
                [value]="value"&gt;{{ value }}
        &lt;/option&gt;
      &lt;/select&gt;
    `,
  })
  export class App implements OnInit, OnDestroy {
    public name: string;
    public selectedValue: string = '';
    public values$: Observable&lt;Array&lt;string&gt;&gt; = new Observable(observer =&gt; this.observer = observer);
    protected observer: Subscriber&lt;Array&lt;string&gt;&gt;;
    protected subscription: Subscription;
  
    constructor() {
      this.name = `Angular! v${VERSION.full}`
    }
  
    ngOnInit() {
      this.subscription = this.values$.subscribe((values) =&gt; {
        console.log('never fired...');
        this.selectedValue = values[0];
      });
  
      setTimeout(() =&gt; {
        this.observer.next(['some', 'test', 'data']);
      });
    }
  
    ngOnDestroy() {
      if (this.subscription) {
        this.subscription.unsubscribe();
      }
    }
  }
  </code></pre>