Clicking a checkbox with ng-click does not update the model

前端 未结 10 1670
太阳男子
太阳男子 2020-12-04 13:17

Clicking on a checkbox and calling ng-click: the model is not updated before ng-click kicks in so the checkbox value is wrongly presented in the UI:

This works in An

10条回答
  •  执念已碎
    2020-12-04 13:37

    How about changing

    
    

    to

    
    

    From docs:

    Evaluate given expression when user changes the input. The expression is not evaluated when the value change is coming from the model.

    Note, this directive requires ngModel to be present.

提交回复
热议问题