ngModel changes, ngModelChange is not called

前端 未结 3 591
星月不相逢
星月不相逢 2021-01-18 01:26

The model gets changed b

3条回答
  •  臣服心动
    2021-01-18 01:52

    //This is a **two way** binding, so below code will not take effect
    [(ngModel)]="trait.userMinimum"  
    (ngModelChange)="setThresholds()" //This will not be fired
    

    The solution is to change as below, and remove the "()" so that the get and set are separate:

    [(ngModel)]="trait.userMinimum" ---> [ngModel]="trait.userMinimum"
    

提交回复
热议问题