Interface that modal content components should implement.
The only requirement is to inject the ModalRef so the component can close itself and optionally return a result.
@Component({ selector: 'ui-confirm-dialog', standalone: true, ... })export class UIConfirmDialog implements UIModalContent<boolean> { readonly modalRef = inject(ModalRef<boolean>); confirm(): void { this.modalRef.close(true); } cancel(): void { this.modalRef.close(false); }} Copy
@Component({ selector: 'ui-confirm-dialog', standalone: true, ... })export class UIConfirmDialog implements UIModalContent<boolean> { readonly modalRef = inject(ModalRef<boolean>); confirm(): void { this.modalRef.close(true); } cancel(): void { this.modalRef.close(false); }}
Readonly
Injected reference used to close the modal and return a result.
Interface that modal content components should implement.
The only requirement is to inject the ModalRef so the component can close itself and optionally return a result.
Example