Don't record invalid values with ng-model

前端 未结 3 1807
陌清茗
陌清茗 2020-12-18 00:08

I really like how the ng-model attribute binds directly to my model and users get instant feedback on their changes. For my use case that\'s perfect. However, I don\'t wan

3条回答
  •  余生分开走
    2020-12-18 00:37

    I believe the default behaviour of AnugularJS validators are not to update the model if the value passed is invalid. If you look at the developer guide and go through Custom Validation these samples also show that the model is not update or is cleared on invalid value provided in the UI

提交回复
热议问题