Angular material not displaying the selectionChange event

Discussão em 'Angular' iniciado por Deepak, Fevereiro 24, 2025.

  1. Deepak

    Deepak Guest

    I am get issue in angular material not displaying 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 observable works properly.

    Continue reading...

Compartilhe esta Página