/angular16-disable-directive

Angular 16 Disable Directive

Primary LanguageTypeScript

Angular Disabled Directive

You are working with Angular Reactive forms and need to disable / enable input fields. In such case Angular gives error saying

It looks like you’re using the disabled attribute with a reactive form directive. If you set disabled to true when you set up this control in your component class, the disabled attribute will actually be set in the DOM for you. We recommend using this approach to avoid ‘changed after checked’ errors.

This example focus on solving above problem using your own custom directive.

Reference link, Thanks!

Enjoy