Answer the question
In order to leave comments, you need to log in
How to make a Button Enabled in Angular if all Checkboxes are selected?
Let's say there is a variable isEnabled = true; isShow = false;
and 4 checkboxes -> md-checkbox`a and one button which is ng-disabled="isEnabled" .
<md-checkbox>
SOME TEXT.....
</md-checkbox>
<md-checkbox ng-if="isShow">
SOME TEXT.....
</md-checkbox>
<md-checkbox>
SOME TEXT.....
</md-checkbox>
<md-checkbox>
SOME TEXT.....
</md-checkbox>
<button ng-disabled="isEnabled"> Delete </button>
Answer the question
In order to leave comments, you need to log in
checkboxes need to be linked to the data model via `ng-repeat`, the data model is an array, create a getter `isButtonDisabled = ()=>checkboxList.some(i=>!i.checked)` bind this getter to the button
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question