Loading libs/forms/CHANGELOG +8 −0 Original line number Diff line number Diff line # Changelog ## [0.20.2] ### Added - (FormDirectives): add extended validation error logger ## [0.20.1] ### Added - (FormDirectives): add extended validation error logger ## [0.20.0] ### Added - (FormControl): add support for reset with the initial state Loading libs/forms/package.json +1 −1 Original line number Diff line number Diff line { "name": "@rxap/forms", "version": "0.20.0", "version": "0.20.2", "private": false, "author": "Merzough Münker", "homepage": "https://gitlab.com/rxap/packages", Loading libs/forms/src/lib/directives/form.directive.ts +34 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,40 @@ export class FormDirective<T extends Record<string, any> = any> extends FormGrou } else { if (isDevMode()) { console.log('Form submit is not valid for: ' + this.form.controlId, this.form.errors); function printErrorControls(control: any) { if (!control.valid) { console.group(control.controlId); if (control.controls) { if (Array.isArray(control.controls)) { for (let i = 0; i < control.controls.length; i++) { const child = control.controls[ i ]; if (!child.valid) { console.group(`index: ${i}`); printErrorControls(child); console.groupEnd(); } } } else { for (const child of Object.values(control.controls)) { printErrorControls(child); } } } else { if (control.errors) { for (const [ key, value ] of Object.entries(control.errors)) { console.group(key); console.log(value); console.groupEnd(); } } console.log('value: ', control.value); } console.groupEnd(); } } printErrorControls(this.form); } this.invalidSubmit.emit(); } Loading Loading
libs/forms/CHANGELOG +8 −0 Original line number Diff line number Diff line # Changelog ## [0.20.2] ### Added - (FormDirectives): add extended validation error logger ## [0.20.1] ### Added - (FormDirectives): add extended validation error logger ## [0.20.0] ### Added - (FormControl): add support for reset with the initial state Loading
libs/forms/package.json +1 −1 Original line number Diff line number Diff line { "name": "@rxap/forms", "version": "0.20.0", "version": "0.20.2", "private": false, "author": "Merzough Münker", "homepage": "https://gitlab.com/rxap/packages", Loading
libs/forms/src/lib/directives/form.directive.ts +34 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,40 @@ export class FormDirective<T extends Record<string, any> = any> extends FormGrou } else { if (isDevMode()) { console.log('Form submit is not valid for: ' + this.form.controlId, this.form.errors); function printErrorControls(control: any) { if (!control.valid) { console.group(control.controlId); if (control.controls) { if (Array.isArray(control.controls)) { for (let i = 0; i < control.controls.length; i++) { const child = control.controls[ i ]; if (!child.valid) { console.group(`index: ${i}`); printErrorControls(child); console.groupEnd(); } } } else { for (const child of Object.values(control.controls)) { printErrorControls(child); } } } else { if (control.errors) { for (const [ key, value ] of Object.entries(control.errors)) { console.group(key); console.log(value); console.groupEnd(); } } console.log('value: ', control.value); } console.groupEnd(); } } printErrorControls(this.form); } this.invalidSubmit.emit(); } Loading