Tengo el botón de radio y la entrada publicados a continuación. Quiero alternar el botón de opción mediante programación para que, cuando configuro this.iAreaOfCoverageForThresholdPasser.average-height en true , el botón de opción se encienda como "resaltado".
html :
<div id="idRadioButtonForAverageHeightDivision"> <input [value]="1" [(ngModel)]="iOperationPasser.averageHeight" name="radioGroupForOperations" type="radio" clrCheckbox (change)="onAverageHeightOptionSelected($event)" [(checked)]="averageHeight"/> <label id="operation-average-height"> {{ "SITE.AREAS_OF_COVERAGE_FOR_THRESHOLD.OPERATION_AVERAGE_HEIGHT" | translate }} <button class="btn btn-sm btn-icon" (click)="showInformation('SERVICE_DIST_4_AGRI')"> <clr-icon shape="help-info" class="is-solid"></clr-icon> </button> </label> </div>.html:
<div id="idRadioButtonForAverageHeightDivision"> <input [value]="1" name="radioGroupForOperations" type="radio" clrCheckbox (change)="onAverageHeightOptionSelected($event)" [(checked)]="iOperationPasser.averageHeight" /> <label id="operation-average-height"> <button class="btn btn-sm btn-icon" (click)="onClick()"> press </button> </label> </div>.ts
iOperationPasser = { averageHeight: true } onClick = () => { this.iOperationPasser.averageHeight=!this.iOperationPasser.averageHeight; }