-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2: Does not respect @IsOptional props #188
Comments
Another unexpected behavior: form.statusChanges emits VALID even though there are customValidateErrors. I don't know if statusChanges was intended to work correctly or if it is recommended to only subscribe to customValidateErrors instead. If so, I suggest to add to documentation which features of the original FormGroup should not be used. |
…ork with isOptional (#188), add excludeGroups for fix recursive errors and unexpected creation of submodels (#185) Add support native Angular validators #183 ``` this.form = this.fb.rootFormGroup( ComboCompany, { name: undefined, // issue #188 regionNum: undefined, // issue #188 }, { angularValidators: { regionNum: [Validators.required] } } // issue #183 ); ``` v2: "Greedy" creation of nested Models causes recursive errors and unexpected creation of submodels #185 ``` export class Company { ... @ValidateNested() @type(() => Department) @expose({ groups: ['nested'] }) department?: Department | undefined; ... } ... this.form = this.formBuilder.rootFormGroup( Department, this.getEmptyDepartment(), { classTransformOptions: { excludeGroups: ['nested'], }, } ); ... ```
…ork with isOptional (#188), add excludeGroups for fix recursive errors and unexpected creation of submodels (#185) Add support native Angular validators #183 ``` this.form = this.fb.rootFormGroup( ComboCompany, { name: undefined, // issue #188 regionNum: undefined, // issue #188 }, { angularValidators: { regionNum: [Validators.required] } } // issue #183 ); ``` v2: "Greedy" creation of nested Models causes recursive errors and unexpected creation of submodels #185 ``` export class Company { ... @ValidateNested() @type(() => Department) @expose({ groups: ['nested'] }) department?: Department | undefined; ... } ... this.form = this.formBuilder.rootFormGroup( Department, this.getEmptyDepartment(), { classTransformOptions: { excludeGroups: ['nested'], }, } ); ... ```
error with IsOptional - fixed, about statusChanges please create example with fork https://stackblitz.com/edit/ngx-dynamic-form-builder-new-api |
Thanks @EndyKaufman ! About reproduction, it will take a some time before I can free some time to write one. Will let you know then! |
Oh dear, I found another one :O
Using a model like
customValidateErrors will always contain an error for User.email.
Though with @IsOptional being set, validation should be skipped if email is undefined or null (and possibly empty string, too).
The text was updated successfully, but these errors were encountered: