diff --git a/src/app/core/directives/matError.directive.ts b/src/app/core/directives/matError.directive.ts index 57e38adc..aad79615 100644 --- a/src/app/core/directives/matError.directive.ts +++ b/src/app/core/directives/matError.directive.ts @@ -51,7 +51,13 @@ export class MatErrorMessagesDirective implements AfterViewInit, OnDestroy { const container = this._inj.get(MatFormField); this.inputRef = container._control; if (this.formControl == null) { - this.formControl = this.inputRef.ngControl.control; + try { + this.formControl = this.inputRef.ngControl.control; + } catch (e) { + throw new Error('FormControl must be provided to mat-error with label: ' + this.label + '\n This ' + + 'can be done by using formControlName, formControl, or ngModel in the relevant mat-form-field. ' + + 'If there is no FormControl needed for the mat-form-field, then the mat-error is redundant, too.'); + } } //console.log(this.label, ' inputRef: ', this.inputRef); diff --git a/src/app/widgets/charts/export/dialog/charts-export-edit-dialog.component.html b/src/app/widgets/charts/export/dialog/charts-export-edit-dialog.component.html index a1967814..022ed8f2 100644 --- a/src/app/widgets/charts/export/dialog/charts-export-edit-dialog.component.html +++ b/src/app/widgets/charts/export/dialog/charts-export-edit-dialog.component.html @@ -75,7 +75,6 @@

Configure Chart

X-Axis -