AngularJS v1.3.16を使用しています。フォームをリセットしたい。
を試しましたが$pristine、エラー メッセージが表示されました。$dirty$setPristine()
HTML:
<form id="userForm" class="form-horizontal ut-form form-validation" role="form" name="userForm" novalidate>
.........
</form>
コード:
$scope.createUser = function () {
$scope.page.view = 'create';
$scope.account = "";
$scope.userForm.$pristine = true;
}
エラー メッセージ:
$setPristine()'$setPristine'- TypeError: のプロパティを読み取れませんundefined$pristine- TypeError: のプロパティ'$pristine'を設定できませんundefined
この問題を解決する方法を教えてください。