Closed
Description
This seems like a really stupid question but I just can't find the answer anywhere.
I want to set the initial state of a checkbox based the initial state of the data object.
Eg the data object may have an attribute "isAvailable" so I want to set the checkbox to match the value of isAvailable.
The problem I am having is that to set the initial state of a check box to checked you add the "checked" attribute to the form control.
(This seems silly as it would seem better to have used checked="true" as you can read the value of the checkbox by reading its "checked" value. Anyway that's not the way it is.)
So it looks like I would have to do an NgIf.
I'm sure there must be an easier way but I just can't find it.
Metadata
Metadata
Assignees
Labels
No labels