I have a mat-select. when I first show the form I want it to select the first item in the select after the data is loaded. How can I do this?
<mat-select
placeholder="period"
(selectionChange)="selectperiod($event)"
(ngModel)="(periodoptions)"
>
<mat-option
*ngFor="let p of periodoptions | async"
[value]="p.periodid"
>
{{ p.periodstart }}
</mat-option>
</mat-select>
using this to call function to pull rest data
of(this.getperiods()).subscribe(pp => {
this.periodoptions = pp;