I would like to know how to make a checkbox checked if the value is true, and unchecked if false with Angular2.
Adult
{{}} does string interpolation and stringifies true and false and Angular by default uses property binding and I assume the property expects boolean values not strings:
This might work as well
because with attribute binding the browser might translate it from the attribute (which can only be strings) to boolean when reading it into its property.
It is also checked instead of value
You can also use ngModel
for one-way or two-way binding.
Ensure your have the FormsModule imported if you use ngModel.