AngularJs .$setPristine to reset form

后端 未结 6 640
耶瑟儿~
耶瑟儿~ 2020-12-05 09:15

I been struggling to reset form once form is submitted. Someone posted this Here which I want to make it work but no success. Here is my My Code Example.

$scop

6条回答
  •  -上瘾入骨i
    2020-12-05 09:42

    There is another way to pristine form that is by sending form into the controller. For example:-

    In view:-

    Name is required.

    In Controller:-

    $scope.addUser = function(myForm) {
           myForm.$setPristine();
    };
    

提交回复
热议问题