In react
<input type='checkbox' checked={true} />
makes the checkbox non toggleable.
However the same in angular makes it toggleable?
<input type='checkbox' [checked]=true />
My use case is multi select dropdown with an max selection value in it. So if the selection is maxed I shouldn't let the user select an option.
Currently I've made it using disabled option something like this.
<input type="checkbox" [name]="option.label" [checked]="option.isSelected"
[disabled]="!option.isSelected && max === selected.length"
(change)="toggleSelectedItem(option.id)">
But I would like to know the reason behind such behaviour in angular? By such behaviour I mean in react if the checked attribute is set to true it doesn't allow user to check or uncheck the item which is what is expected. Why isn't it the case with angular?