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

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

    1. Use name attr instead of id. name="forName"
    2. The form reference inside Controller will be $scope.formName

提交回复
热议问题