ngx-formly: Disable the form on NgOnInit doesn't disable formly
Description
export class AppComponent implements OnInit{
form = new FormGroup({});
ngOnInit(){
this.form.disable();
}
Minimal Reproduction If on init I disable the form, it doesn’t work the disable.
https://stackblitz.com/edit/angular-fpuvb7
Your Environment
- Angular version: 7.2.16
- Formly version: 5.10.6
Additional context
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 33 (28 by maintainers)
Commits related to this issue
- fix(core): take account of parent disable state on init (#2610) fix #2598 — committed to ngx-formly/ngx-formly by aitboudad 4 years ago
- fix(core): detect disabled state for CD OnPush components (#2612) fix #2598 — committed to ngx-formly/ngx-formly by aitboudad 4 years ago
Now it’s working on stackblitz @aitboudad
https://stackblitz.com/edit/angular-ivy-fnrshf?file=src%2Fapp%2Fshared%2Ferror.handler.ts
https://angular-ivy-fnrshf.stackblitz.io/#/complexidade