2

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' : ''}}>

Thanks!

1 Answer 1

4
<input type="checkbox" [checked]="mybool">

or

<input type="checkbox" [(ngModel)]="mybool">
Sign up to request clarification or add additional context in comments.

1 Comment

As simple as that... Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.