I have a radio button with Bootstrap 4, and it works well, less than when I put one, it does not stay checked:
I have it in an application with Angular 4, and I do not know if I have to do it with an attribute or what syntax I should use, specifically.
Someone can help me, I was missing to check the buttons
Just start the screen are all unchecked.
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="options" id="option1" [value]="HOY" [(ngModel)]="sinImputarValue" (click)="sinImputarHoy();"> SIN IMPUTAR HOY
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="option2" [value]="SEMANA" [(ngModel)]="sinImputarValue" (click)="sinImputarSemana();"> SIN IMPUTAR ESTA SEMANA
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="option3" [value]="MES" [(ngModel)]="sinImputarValue" (click)="sinImputarMes();"> SIN IMPUTAR ESTE MES
</label>
</div>
sinImputarHoy(){
console.debug("sinImputarHoy");
this.limpiarFiltroManual();
this.sinImputarValue = 'HOY';
}
sinImputarSemana(){
console.debug("sinImputarSemana");
this.limpiarFiltroManual();
this.sinImputarValue = 'SEMANA';
}
sinImputarMes(){
console.debug("sinImputarMes");
this.limpiarFiltroManual();
this.sinImputarValue = 'MES';
}