mardi 13 décembre 2016

Angular2 ngModel checkbox undefined

Just a quick question if anyone knows how to solve this but I have some issues with a checkbox input.

It's configured in the following way

<input type="checkbox" [(ngModel)]="settings.ht_enabled" (ngModelChange)="changeSetting('ht_enabled')" id="setting-ht_enabled"> <label for="setting-ht_enabled">ht enabled</label>

Every time I click the checkbox the value of my model becomes undefined, and the (ngModelChange) gets triggered which only does a console.log. Did anyone had any similar issues and knows how to solve this?




Aucun commentaire:

Enregistrer un commentaire