Skip to content
Snippets Groups Projects
Commit 4f6960d5 authored by kasperlauge's avatar kasperlauge
Browse files

Changed to native event

parent c5d0cce8
No related branches found
No related tags found
1 merge request!1Swagger improvements
......@@ -5,7 +5,7 @@
<li *ngFor="let led of leds" class="list-item">
<h3 class="led-title">LED {{led.id}}</h3>
<label class="switch">
<input type="checkbox" [checked]="led.value" (change)="onValueChange(led.value, led.id)">
<input type="checkbox" [checked]="led.value" (change)="onValueChange($event.target.checked, led.id)">
<span class="slider round"></span>
</label>
</li>
......
......@@ -28,9 +28,9 @@ export class LedPresentationComponent implements OnInit {
});
}
onValueChange(currentValue: string, id: number) {
console.log(currentValue);
if (+currentValue === 1) {
onValueChange(checked: boolean, id: number) {
console.log(checked);
if (!checked) {
this.setOff(id);
} else {
this.setOn(id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment