Skip to main content

glintCreateModel

The glintCreateModel directive provides a convenient way to trigger the creation of a new model element directly from a user interaction, such as a button click. When activated, it initiates a model creation task based on the provided configuration.

Usage

Apply the glintCreateModel directive to any interactive HTML element (e.g., a <button>, <a>, or <div>) and bind it to an instance of CreateModelTask. The newModel helper function is typically used to generate this task.

<button [glintCreateModel]="newModel(componentModel, 'elements::DataElement')">
New DataElement
</button>

Properties

  • [glintCreateModel]: This input property expects an instance of CreateModelTask. This object encapsulates all the necessary information for creating a new model element.

Helper Function: newModel(parent, type)

The newModel function is a utility provided to easily construct a CreateModelTask object.

Parameters

  • parent: The model element to which the newly created element will be attached. This serves as the hierarchical parent in your model structure.
  • type: The element type of the element to be created,