title: Angular automatically select the Mat-Select when there is only one option
body: <p>I need to set default value if there is one one option in the mat-select. otherwise leave black to select by user.
  This is my code in HTML</p>
  
  <pre><code>&lt;mat-form-field&gt;
  &lt;mat-select (selectionChange)="CompartSelected($event, element, cmpart)" disableRipple [value]="element.Compart.Id" name="cmpart" &gt;
    &lt;mat-option *ngIf="getAvailableCompartList(element.Compart.CompartType.Id).length &gt; 1" value=""&gt;-- Please Select an Option --&lt;/mat-option&gt;
    &lt;mat-option *ngFor="let cmpart of getAvailableCompartList(element.Compart.CompartType.Id)" title="{{Translate(cmpart.CompartNote)}}" 
        [value]="cmpart.Id"&gt;{{cmpart.CompartTitle}}
    &lt;/mat-option&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>according to the @Sean solution I have update the code. But it doesn't set the value to the mat-select.
  I have attached some pic of those mat-select.</p>
  
  <p><a href="https://i.stack.imgur.com/3kBCa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3kBCa.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/zAYTS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zAYTS.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/8ih3k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8ih3k.png" alt="enter image description here"></a></p>