-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Description
Reproduction link
ng-zorro doesn't compile in stackblitz
↑
Error in /turbo_modules/ng-zorro-antd@20.4.2/fesm2022/ng-zorro-antd-input.mjs (366:856)
Cannot access 'NzInputDirective' before initializationSteps to reproduce
In my gif below, I'm using the same formGroup.
If I change the "text component" via click, it will trigger resetForm()
In the dev window you can see the classes "ng-untouched ng-pristine ng-valid" but also "ant-input-status-error".
rootFormGroup = inject(FormGroupDirective)
constructor() {
effect(() => {
if (this.currentId !== this.component().uid) {
this.currentId = this.component().uid
this.resetForm()
}
})
}
resetForm() {
this.form = this.rootFormGroup.control
Object.keys(this.form.controls).forEach((key) => this.form.removeControl(key))
this.form.addControl('text', this.fb.control(this.component().attributes.text, Validators.required))
this.form.addControl('required', this.fb.control(this.component().attributes.required))
this.form.addControl('placeholder', this.fb.control(this.component().attributes.placeholder))
this.form.addControl('multiple_rows', this.fb.control(this.component().attributes.multiple_rows))
this.form.get('text')!.updateValueAndValidity() // This doesn't do anything
}What is expected?
Should validate
What is actually happening?
It doesn't
| Environment | Info |
|---|---|
| ng-zorro-antd | 20.4.2 |
| Browser | Chrome |
Metadata
Metadata
Assignees
Labels
No labels
