angular checkbox disabled 1

angular checkbox disabled

[attr.disabled]="isDisabled ? true : null"

Here is what the above code is Doing:
1. We are using the @Input() decorator to make the disabled property available for binding by a parent component.
2. We are using the @HostBinding() decorator to bind the disabled property to the disabled attribute of the host element.
3. We are using the @HostListener() decorator to listen to the mouseenter and mouseleave events of the host element.
4. We are using the @HostBinding() decorator to bind the class.is-disabled property to the class attribute of the host element.
5. We are using the @HostBinding() decorator to bind the attr.disabled property to the disabled attribute of the host element.

Similar Posts