ng-zorro-antd icon indicating copy to clipboard operation
ng-zorro-antd copied to clipboard

"Prevent default" for checkbox

Open ifree92 opened this issue 4 years ago • 0 comments

What problem does this feature solve?

I want to have a checkbox where I'm able by click on checkbox prevent its state changing. The only way to do that - disable checkbox. However, when I'm trying to use [ngModel]="checked", but then try to intercept status changing by (ngModelChange)="onModelChange($event)" and then try to accept default value, e.g.:

onModelChange(_: boolean) {
  this.checked = false;
}

Nothing happened, the checkbox is still changing its status.

What does the proposed API look like?

The same as shown previously, just to bind the ngModel status to the actual checkbox UI status.

ifree92 avatar Aug 14 '20 15:08 ifree92