Service for opening modal dialogs programmatically using the native
HTML5 <dialog> element.
This is the imperative counterpart to the declarative
UIDialog component. Use this service when you need to
dynamically render a component, pass inputs/outputs, and collect a
typed result via ModalRef.closed.
Rule of thumb: reach for ModalService when the dialog must be
spawned dynamically, reused across features, or opened from
non-component code. Reach for UIDialog when you own the
template and the dialog lives alongside its trigger.
Service for opening modal dialogs programmatically using the native HTML5
<dialog>element.This is the imperative counterpart to the declarative UIDialog component. Use this service when you need to dynamically render a component, pass inputs/outputs, and collect a typed result via ModalRef.closed.
When to use
ModalServicevs UIDialogModalServiceModalServiceModalRef.closed)ModalServiceModalService[(open)])Rule of thumb: reach for
ModalServicewhen the dialog must be spawned dynamically, reused across features, or opened from non-component code. Reach for UIDialog when you own the template and the dialog lives alongside its trigger.Example