@Input() configs: FormControlConfig[] | string = [];
@Input() customComponents?: CustomComponents;
@Input() customTemplates?: CustomTemplates;
@Input() conditionsActionFuntions?: ConditionsActionFunctions;
@Input() hideErrorMessage?: boolean;
@Input() collapsibleState?: FormLayout['contentCollapsible'];
@Input() errorComponents?: CustomErrorComponents;
@Input() errorComponentDefault?: Type<CustomErrorMessage>;
@Input() errorTemplates?: CustomTemplates;
@Input() errorTemplateDefault?: TemplateRef<any>;
@Input() labelComponents?: CustomLabelComponents;
@Input() labelComponentDefault?: Type<CustomFormLabel>;
@Input() labelTemplates?: CustomTemplates;
@Input() labelTemplateDefault?: TemplateRef<any>;
@Input() loadingComponent?: Type<any>;
@Input() loadingTemplate?: TemplateRef<any>;
@Input() optionsSources?: { [key: string]: Observable<OptionItem[]> };
See Configs.
See Custom Components.
Control the display of all the error messages. Useful when need to show all the errors immediately when submit button is clicked.
<ng-dynamic-json-form
...
[formControl]="control"
[hideErrorMessage]="hideErrors"
></ng-dynamic-json-form>
<button type="submit" (click)="submit()"></button>
control = new FormControl();
hideErrors?: boolean;
submit(): void {
if (this.control.invalid) {
this.hideErrors = false;
return;
}
...
}
In order to trigger change detection, we must leave the
hideErrors
undefined at first, then set its value later when submit button is pressed.
Control all of the collapsible states.
The custom observables for options. See Use custom observable.
errorComponents
errorComponentDefault
errorTemplates
errorTemplateDefault
See Custom Error.
labelComponents
labelComponentDefault
labelTemplates
labelTemplateDefault
See Custom Label.
loadingComponent
loadingTemplate
See Custom Loading.
@Output() formGet = new EventEmitter<UntypedFormGroup>();
@Output() optionsLoaded = new EventEmitter();
@Output() displayValue = new EventEmitter<FormDisplayValue>();
@Output() updateStatusFunctions = new EventEmitter<FormStatusFunctions>();
The event called after form generation complete. The generated UntypedFormGroup
will be emitted.
The event of form value when it's changed by user.
The event called after all of the options are loaded.
Useful if you need to get the form.value
with either:
{
keyMapped: any;
keyPreserved: any;
}
Emit all the functions needed to change form status.
{
setDirty: () => void;
setPristine: () => void;
setTouched: () => void;
setUntouched: () => void;
}