Skip to main content

glintDeleteModel

The glintDeleteModel directive provides a declarative way to enable deletion functionality for specific model elements through user interaction, typically a click event. For safety, it automatically presents a confirmation dialog to the user before proceeding with the deletion.

Usage

Apply the glintDeleteModel directive to an interactive HTML element (like a <button> or <a>). Bind the model element you wish to delete to the [glintDeleteModel] input. You can also customize the confirmation message using [confirmMessage].

<button
[glintDeleteModel]="modelToDelete"
confirmMessage="Are you sure you want to permanently delete this item? This action cannot be undone.">
Delete Item
</button>

Properties

  • [glintDeleteModel]: This required input property accepts the model element instance that is targeted for deletion. When the element is clicked, the directive will attempt to delete this specific model.
  • [confirmMessage]: This required input property accepts a string that will be displayed in the confirmation dialog. You can use string interpolation within the message if you're binding it from your component.