<input pInputText type="checkbox" [(ngModel)]="rowData.active">
active is a string. It's value is 'true' or 'false'. I wanna bind this string value to a checkbox.
So how can I do that?
not use "banana syntax"
<input type="checkbox"
[ngModel]="rowData.active=='true'?true:false"
(ngModelChange)="rowData.active=$event?'true':'false'"
>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With