Если вы хотите очистить всю форму, вы можете использовать такой подход. Это ваша модель в контроллер:
$scope.registrationForm = {
'firstName' : '',
'lastName' : ''
};
Ваш HTML:
<form class="form-horizontal" name="registrForm" role="form">
<input type="text" class="form-control"
name="firstName"
id="firstName"
ng-model="registrationForm.firstName"
placeholder="First name"
required> First name
<input type="text" class="form-control"
name="lastName"
id="lastName"
ng-model="registrationForm.lastName"
placeholder="Last name"
required> Last name
</form>
Затем вы должны клонировать/сохранить прозрачное состояние по:
$scope.originForm = angular.copy($scope.registrationForm);
Ваша функция сброса будет:
$scope.resetForm = function(){
$scope.registrationForm = angular.copy($scope.originForm); // Assign clear state to modified form
$scope.registrForm.$setPristine(); // this line will update status of your form, but will not clean your data, where `registrForm` - name of form.
};
В таком случае вы можете очистить в целом ваша форма
Добавить HTML входа, пожалуйста. –