How do I clear or reset data in a form in angularjs?

前端 未结 5 1354
误落风尘
误落风尘 2021-01-16 21:48

Been finding how to clear form data with the use of angular and $setPristine Function but still no results always gives me an error saying $setPristine is not a function. Ca

5条回答
  •  日久生厌
    2021-01-16 22:06

    You can set the form with the code below:

    $scope.customerForm.$setPristine();
    $scope.customerForm.$setUntouched();
    $scope.CustDetails={};
    

提交回复
热议问题