Why does angular select onModelChange execute so many times?

    <nz-form-item>
      <nz-form-label nzRequired nzSpan="7"></nz-form-label>
      <nz-form-control nzSpan="10">
        <nz-select formControlName="roomId" nzAllowClear nzShowSearch (nzOnSearch)="onSearchRoom($event)" (ngModelChange)="onSearchCustomer()">
          <nz-option *ngFor="let item of roomList" [nzValue]="item.room_id" [nzLabel]="item.room_no"></nz-option>
        </nz-select>
        <nz-form-explain *ngIf="isInvalid("roomId")"></nz-form-explain>
      </nz-form-control>
    </nz-form-item>
    
      async onSearchRoom(search?) {
    const { data } = await this.api.get("repair/rooms")({
      room_no: search,
    });
    this.roomList = data;
     console.log("change room")
  }

  async onSearchCustomer() {
    const { data } = await this.api.get("repair/get-customer-by-room")({
      room_id: this.add.value.roomId,
    });
    this.customer_id = data.customer_id
    console.log(data.customer_name)
    this.add.setValue({
      customerName: data.customer_name,
      roomId: this.add.value.roomId,
      repairPerson: this.add.value.repairPerson,
      repairPhone: this.add.value.repairPhone,
      repairTime: this.add.value.repairTime,
      repairOrderTime: this.add.value.repairOrderTime,
      // projectId: this.add.value.projectId,
      projectName: this.add.value.projectName,
      repairCostType: this.add.value.repairCostType,
      repairCostPrice: this.add.value.repairCostPrice,
    })
  }

clipboard.png

the choice you want to achieve is to apply for option changes in the repair room and request the associated household to assign a value to the household who applied for repair, but will always call onSearchCustomer.

Nov.29,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea2d98-1c07.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea2d98-1c07.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?