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 :

  1. import the component :

import {CmsDialogCreateComponent} from '@tradinos/cms-frontend-entity';
  1. The selector for component , like it :

<lib-cms-dialog-create></lib-cms-dialog-create>

Features

  1. Dynamic Form Building:

    • Utilizes the GenericFormBuilderComponent to dynamically generate forms based on the provided schema.

  2. Form Value Transformation:

    • Automatically applies transformations like removing null values or converting the form data to a specific format (e.g., FormData).

  3. Entity Creation:

    • Uses the CmsService.create method to submit the form data and create new entities.

  4. Dialog Management:

    • Manages dialog lifecycle, including opening and closing the dialog with optional result data.

  5. 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.

  1. submit(): void

    • Description: Handles form submission and entity creation.

Last updated