Javascript 如何清除angular中的angular下拉列表值?

Javascript 如何清除angular中的angular下拉列表值?,javascript,angularjs,angular,typescript,Javascript,Angularjs,Angular,Typescript,如何清除angular中的angular下拉列表值?用x按钮或清除按钮清除所选内容?多谢各位 密码 尝试在单击事件时设置selectedValue.value=undefined> e、 g 工作演示: <div fxFlex fxLayout="row" formGroupName="people"> <mat-form-field appearance="outline" class=&quo

如何清除angular中的angular下拉列表值?用x按钮或清除按钮清除所选内容?多谢各位

密码 尝试在单击事件时设置selectedValue.value=undefined>

e、 g

工作演示:

<div fxFlex fxLayout="row" formGroupName="people">
          <mat-form-field appearance="outline" class="pr-4" fxFlex>
            <mat-label>People</mat-label>
            <mat-select formControlName="people">
              <mat-option *ngFor="let people of Peopls" [value]="peope.value">
                {{ people.literal }}
              </mat-option>
            </mat-select>
          </mat-form-field>

 <button mat-button *ngIf="" matSuffix mat-icon-button 
    aria-label="Clear" (click)="";>
  <mat-icon>close</mat-icon>

        </div>
      </div>
<div >
          <mat-form-field>
            <mat-label>People</mat-label>
            <mat-select #selectedValue >
              <mat-option *ngFor="let p of people" [value]="p.value">
                {{ p.value }}
              </mat-option>
            </mat-select>
          </mat-form-field>
 <button mat-button (click)="selectedValue.value=undefined">X</button>
 </div>