Reputation: 3852
I have this checkbox when user.IsActive
is 0
still the checkbox is checked
<input type="checkbox" [(ngModel)]="user.IsActive" (change)="user.IsActive = $event.target.checked ? 1: 0" [checked]="user.IsActive == 1 || user.IsActive=='1' ? true : false">
i have used this condition [checked]="user.IsActive == 1 || user.IsActive=='1' ? true : false"
but it's not working.
Any solution Thanks
Upvotes: 0
Views: 131
Reputation: 237
Jay Swaminarayan Try this
<input type="checkbox" (change)="user.IsActive = !user.IsActive" [checked]="user.IsActive">
Upvotes: 1