TCB Dialog Create
The CmsDialogCreateComponent is a dynamic Angular component designed for creating new entities in a modal dialog. It integrates with the CmsService to handle form submission, data transformations, and entity creation. The component also supports dynamic form building through the GenericFormBuilderComponent.
How to use the component in your app :
import the component :
import {CmsDialogCreateComponent} from '@tradinos/cms-frontend-entity';The selector for component , like it :
<lib-cms-dialog-create></lib-cms-dialog-create>Features
Dynamic Form Building:
Utilizes the
GenericFormBuilderComponentto dynamically generate forms based on the provided schema.
Form Value Transformation:
Automatically applies transformations like removing null values or converting the form data to a specific format (e.g.,
FormData).
Entity Creation:
Uses the
CmsService.createmethod to submit the form data and create new entities.
Dialog Management:
Manages dialog lifecycle, including opening and closing the dialog with optional result data.
Change Detection:
Ensures the UI is updated correctly using Angular's
ChangeDetectorRef.
Methods
1. ngOnInit(): void
Description: Lifecycle hook called when the component initializes.
Behavior: Triggers change detection to ensure the form builder and UI are rendered correctly.
submit(): voidDescription: Handles form submission and entity creation.
Last updated