Whenever I try to execute the code below to reset my form, I encounter an error:
$scope.resetForm = function () {
$scope.testForm.$setPristine();
}
Here is the HTML snippet:
<form name="testForm" >
<label class="item item-input item-stacked-label">
<span class="input-label">Title</span>
<input type="text" ng-model="formData.shortDesc" required="">
</label>
<button class="button button-block button-positive" type="submit" ng-click="resetForm()" >Save </button>
</form>