如何在角度js中清除表格或重置事件后
<form>
<label>filed 1</label>
<input type='text'/><br/>
<label>field 2</label>
<input type='text'><br/>
<a href ='javascript:void(0);' class='btn brn-succees'>reset</a>
</form>
客户js ca不能改变
$('.btn').click(function(e) {
e.curentTarget.reset()
});
角度指令
auto.fill.form.Directive = ($localstorage) ->
resetForm = (e) ->
# load form data
restrict: 'E'
replace: false
link: (scope, element) ->
if autoFillElements.length > 0
element.on 'reset', resetForm
auto.fill.form.Directive.$inject = ['$localstorage']
angular.module ['auto.fill.form', '1.0.0'], []
.directive 'form', auto.fill.form.Directive
有必要在净化形式
之后调用resetForm方法