Reputation: 165
I want to make the checkbox checked and unchecked from the function based on value , if suppose checkbox value is 120, how to make that checkbox checked
<input type="checkbox" [checked] = "isEnabled" value={{rowData.FILE_LOAD_ID}} id={{rowData.FILE_LOAD_ID}}>
Upvotes: 6
Views: 15385
Reputation: 1468
[checked] = "isEnabled()"
add function
isEnabled() {
return this.someValue === 120;
}
Upvotes: 5
Reputation: 9687
you can use [checked] = "rowData.FILE_LOAD_ID==120"
<input type="checkbox" [checked] = "rowData.FILE_LOAD_ID==120" value={{rowData.FILE_LOAD_ID}} id={{rowData.FILE_LOAD_ID}}>
Upvotes: 6