I have an array of object:
keyDisabledArray=[
{'a':false},
{'b':true}
]
and some buttons
<button class="key" (click)="keyPressed('a')" id="a">A</button>
<button class="key" (click)="keyPressed('b')" id="b">B</button>
that must be disabled according to the content of keyDisabledArray. In this case, button 'b' must be disabled and 'a' enabled. I'm trying to use [disabled] but I'm not sure how to access the correct value in the array of objects.
EDIT: I found some ways to access the value, but all were asynchronous or demanding a full loop on the array to find the correct element, and in both cases, I see problems: how angular deal with asynchronous code in front end (?) and if it is possible to avoid a full loop on the array for every button.