Bootstrap Angular - Checkbox value is not working

11.1k views Asked by At

I am using angular 4 for page design. The checkbox is not getting selected no matter what value I pass, below is my code for same -

<div class="form-check">
    <label class="form-check-label">
      <input type="checkbox" value="false"> No
    </label>
</div>

I have tried with value="true", value=true, checked="true", checked=true. My intention is to use an expression or a dynamic value to set check box selection. Any help would be greatly appreciated.

1

There are 1 answers

1
Aravind On BEST ANSWER

As per comment,

Use ngModel

<div class="form-check">
    <label class="form-check-label">
       <input type="checkbox" [ngModel]="false"> No
    </label>
</div>