I have a select that is connected with another one, when there is a selection on the first one the second one becomes required, I am doing that by jquery on the controller
<select id="month-selector" name="month" ng-change="controller.setRequired()">
</select>
<select id="year-selector" name="year">
</select>
//controller
$("#year-selector").prop('required', true);
On my form I have an add button which is enable/disable according with the form validity
<button ng-disabled="!controller.myForm.$valid">
Add
</button>
So when I select an option on the first select I want the button to be disable until I choose an option on the second select, I have tried setting the second select on the dirty state in order to trigger the form invalidity but it didn't work.
//controller
$("#year-selector").prop('required', true);
myForm.customerSinceYear.$setDirty();