I want to use the bootstrap toggle buttons(switch buttons) in angular.(The components has to come dynamically from the backend ).
I have tried but toggling the switches is not working properly.
.component.html
<div *ngFor ="let sensor of sensors;let i =index" (ngModelChange)="dataChanged(selectsensor)" >
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" (click)="dataChanged(sensor,i)" id="customSwitches">
<label class="custom-control-label" for="customSwitches">
{{sensor.name}} </label>
</div>
</div>