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

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

    use:

    $scope.$destroy 
    

    as it removes all the children associated to the parent scope and will clear all the data associated with it.

提交回复
热议问题