I want to disable checkbox if value = 2. here is what i tried so far.
discheckcondition = [1,2,3];
for (let x = 0; x < this.discheckcondition.length; x++) {
// console.log(this.discheckcondition[x]);
if (this.discheckcondition[x] = '2') {
console.log(this.discheckcondition[x]);
this.disablecheckfornext = '1';
};
}
<ng-container *ngFor="let value of values;">
<label>
<input id="checkbox_group1" type="checkbox" pattern="[0-9]{10}" [disabled]=" disablecheckfornext == '1'" value="value.id" (change)="onCheckboxChange($event)"/>
</label>
</ng-container>
Can someone help me for the same? here the problem is all text-boxes are getting disabled.
if (this.discheckcondition[x] = '2')
. Should be == or ===