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

前端 未结 5 1352
误落风尘
误落风尘 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:26

    Use

    $scope.customerForm.$setPristine(true);
    

    Give the form a name like

    name= "CusDetails"
    

    Then It will solve the problem.

提交回复
热议问题