angularjs form reset error

前端 未结 13 1640
长发绾君心
长发绾君心 2020-12-03 04:14

i\'m trying to do a form with validations using angularjs and so far i did a good job. But when i commit my reset button all the fields reset except for the error messages i

相关标签:
13条回答
  • 2020-12-03 05:11

    I went with...

    $scope.form.$setPristine();
    $scope.form.$error = {};
    

    Feels hacky... but a lot about angular does.

    Besides... this was the only thing that worked.

    0 讨论(0)
提交回复
热议问题