角材料不显示SelectionChange事件

问题描述 投票:0回答:1

我在不显示SelectionChange的角度材料中获得问题

<!-- Customer Dropdown --> <mat-form-field appearance="fill" class="customer-dropdown"> <mat-label>Select Customer</mat-label> <mat-select (selectionChange)="onCustomerChange($event.value)"> <mat-option *ngFor="let customer of customers$ | async as customers" [value]="customer.id"> {{ customer.name }} </mat-option> </mat-select> </mat-form-field>
 customerWithFilter$ = this.customerWithProjects$.pipe(map(customers =>
    customers.filter(customers => customers.id  == this.selectedCustomerId )

  ));

  filterProjects(): void {
     this.customerWithFilter$ 
  }

  onCustomerChange(customerId: number): void {
     customerId = this.selectedCustomerId ;
    this.filterProjects();
  }

customerwithfilter可观察到的作品正确。
    

thanks对于穆拉利的建议,我在customer.first_name参数中找到了问题。

<mat-form-field appearance="fill" class="customer-dropdown"> <mat-label>Select Customer</mat-label> <mat-select (selectionChange)="onCustomerChange($event.value)"> <mat-option *ngFor="let customer of customers$ | async as customers" [value]="customer.id"> {{ customer.first_name }} </mat-option> </mat-select> </mat-form-field>
angular angular-material
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.