I am trying to show/hide and adjust the ng-required status if a checkbox is checked, but it doesn't seem to managing the variables properly. Here my examples:
<input type="checkbox" ng-model="checkboxdmodel.value" ng-true-value="'YES'" ng-false-value="'NO'">
Input that I want required unless the checkbox is checked in which case it should be hidden and not required:
<div class="form-group" ng-hide="checked.YES">
<label class="col-sm-3 control-label" for="inputamount">
<font color="red">*</font>Expense Amount</label>
<div class="col-sm-8">
<input type="number" class="form-control" id="inputamount" data-ng-model="itemamount" step="any" ng-required="checked.NO"/>
</div>
</div>
checkboxdmodel? No typo? And in theng-hideisn't itcheckboxdmodel.checked.YES?checkboxmodel.valueby changing yourng-hidetong-hide="checkboxmodel.value". If the box is checked this value will be 'true' and the div will be hidden, otherwise it will be shown.