Delete Records Modal
This section describes the BfmDeleteRecordsModalComponent component.
Composition
The BfmDeleteRecordsModalComponent has no any composition component.
Usage
You must to import the BfmDeleteRecordsModalComponent and provide it to ModalService to open the modal.
info
Modals are not components. They must be used with the ModalService to be opened.
To a better understanding, check the Modals documentation.
deleted-records-modal.component.ts
import { BfmDeleteRecordsModalComponent } from '@celerofinancas/ui-cash-flow';
import { ModalService } from "@celerofinancas/ui-modals";
import { Component, inject } from '@angular/core';
@Component({
standalone: true,
selector: 'delete-records-modal',
templateUrl: './deleted-records-modal.component.html',
})
export class DeleteRecordsModalComponent {
/**
* Modal service for handling modals
*/
private modalService = inject(ModalService);
/**
* Open the modal
*/
public openModal(): void {
this.modalService.open(BfmDeleteRecordsModalComponent, {
records: financialRecords,
title: 'Confirm Deletion',
submitText: 'Delete',
cancelText: 'Cancel',
message: 'Are you sure you want to delete these records?',
});
};
}
Inputs
The BfmDeleteRecordsModalComponent modalRef has the following inputs:
records
List of financial records to be deleted
| Type | Default |
|---|---|
| FinancialRecord[] | [] |
title
Modal title
| Type | Default |
|---|---|
string | 'Deletar registros' |
submitText
Submit button text
| Type | Default |
|---|---|
string | 'Estou ciente, confirmar deleção' |
cancelText
Cancel button text
| Type | Default |
|---|---|
string | 'Cancelar' |
message
Confirmation message
| Type |
|---|
string |
Events
The BfmDeleteRecordsModalComponent modalRef has the following events:
onConfirm$
Observable for confirmation action
| Type |
|---|
Observable<any> |