0
我對AngularJS比較陌生。我有一個複選框的列表,最新的是強制性的。最初所有這些都將被檢查。現在我需要至少有一個應該一直檢查。我不想發出驗證消息,但需要當用戶試圖取消選中最後一個複選框,那麼它將無法做到這一點。我試圖通過使用angularJS來實現。選擇至少一個複選框AngularJS
<div class="form-group">
<div class="col-sm-12">
<label for="search" class="lbl">
<i class="fa fa-link"></i> Include:
</label>
<div class="row">
<div class="col-sm-4">
<input type="checkbox" id="uploadCB" ng-model="auditLog.searchObj.upload" tabindex="0">
<label for="uploadCB" class="checkbox-white-label" id="uploadCheckBox"></label> Upload
</div>
<div class="col-sm-1 form-control-static">
</div>
<div class="col-sm-6">
<input type="checkbox" id="editCB" ng-model="auditLog.searchObj.edit" tabindex="0">
<label for="editCB" class="checkbox-white-label" id="editCheckBox"></label> Edit
</div>
</div>
<div class="row">
<div class="col-sm-4">
<input type="checkbox" id="downloadCB" ng-model="auditLog.searchObj.download" tabindex="0">
<label for="downloadCB" class="checkbox-white-label" id="downloadCheckBox"></label> Download
</div>
<div class="col-sm-1 form-control-static">
</div>
<div class="col-sm-6">
<input type="checkbox" id="userLogCB" ng-model="auditLog.searchObj.userLog" tabindex="0">
<label for="userLogCB" class="checkbox-white-label" id="userLogCheckBox"></label> User Log
</div>
</div>
<div class="row">
<div class="col-sm-4">
<input type="checkbox" id="readMarksCB" ng-model="auditLog.searchObj.readMarks" tabindex="0">
<label for="readMarksCB" class="checkbox-white-label" id="readMarksCheckBox"></label> Read Marks
</div>
<div class="col-sm-1 form-control-static">
</div>
<div class="col-sm-6">
<input type="checkbox" id="userCreationCB" ng-model="auditLog.searchObj.userCreationEdit" tabindex="0">
<label for="userCreationCB" class="checkbox-white-label" id="userCreationCheckBox"></label> User Creation/Edit Log
</div>
</div>
<div class="row">
<div class="col-sm-4">
<input type="checkbox" id="superCedeCB" ng-model="auditLog.searchObj.superCede" tabindex="0">
<label for="superCedeCB" class="checkbox-white-label" id="superCedeCheckBox"></label> Supercede
</div>
</div>
</div>
</div>
我能夠用NG-需要觸發一個驗證消息,但我需要禁用最後剩下的複選框。有沒有人有任何想法我該怎麼辦?提前致謝。
哪裏** **控制器? – Rayon