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

前端 未结 10 1674
太阳男子
太阳男子 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:56

    .task{ng:{repeat:'task in model.tasks'}}
      %input{type:'checkbox',ng:{model:'$parent.model.tasks[$index].enabled'}}
    

提交回复
热议问题