dialog.html 678 Bytes
<h1 mat-dialog-title>Found {{data.users.length}} Users</h1>

<mat-form-field>
  <mat-select [(value)]="selected"
              [compareWith]="compareFn"
              [formControl]="UserSelectControl"
              placeholder="Choose a User" required>
    <mat-option *ngFor="let u of data.users" value="{{u.id}}">{{u.username}}</mat-option>
  </mat-select>
  <mat-error *ngIf="UserSelectControl.hasError('required')">Please choose a User</mat-error>

</mat-form-field>
<div style="float: right">
  <button mat-raised-button (click)="onNoClick()">Cancel</button>
  <button mat-raised-button color="primary" [mat-dialog-close]="selected" cdkFocusInitial>Confirm</button>
</div>