我在
我尝试使用
HTML5表单
中有一个ng-form
包裹的复选框
,我希望将其排除在外,以便它不会改变我的表单$state
($pristine
或者 $dirty
)。我尝试使用
ignoreDirty
指令 - Angular 1.2: Is it possible to exclude an input on form dirty checking? 和其他一些解决方案,但都无法在HTML5表单
内使用ng-form
。以下是一些示例代码:<form name="mainForm" class="col-xs-10 form-validation" novalidate>
<ng-form name="innerForm">
<div>
<span>check my
<span ng-if="vm.utils.mode!=='readonly'">
<input type="checkbox"
ng-model="vm.utils.amalotSecond"
class="secondYearCheckBox">
</span>
</span>
</div>
</ng-form>
<form>
form
不能有子元素form
。只需将其删除,因为它不符合 HTML 规范。 - lin