matth3o matth3o - 1 year ago 226
Dart Question

Dart Angular2 - bind component boolean with checkbox value

I'd like to know if there is a way to bind a regular checkbox in a template :

<input type="checkbox">

with a boolean in my component.

Bonus question : Otherwise is there a way to do

<input type="checkbox" {{mybool ? 'checked' : ''}}>


Answer Source
<input type="checkbox" [checked]="mybool">


<input type="checkbox" [(ngModel)]="mybool">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download