Type Parameters

  • T

Hierarchy

  • NgbModalRef
    • NgbModalWrapper

Constructors

  • Type Parameters

    • T

    Parameters

    • _windowCmptRef: ComponentRef<NgbModalWindow>
    • _contentRef: ContentRef
    • Optional_backdropCmptRef: ComponentRef<NgbModalBackdrop>
    • Optional_beforeDismiss: (() => boolean | Promise<boolean>)
        • (): boolean | Promise<boolean>
        • Returns boolean | Promise<boolean>

    Returns NgbModalWrapper<T>

Properties

result: Promise<any>

The promise that is resolved when the modal is closed and rejected when the modal is dismissed.

Accessors

  • get closed(): Observable<any>
  • The observable that emits when the modal is closed via the .close() method.

    It will emit the result passed to the .close() method.

    Returns Observable<any>

    8.0.0

  • get componentInstance(): T
  • The instance of a component used for the modal content.

    When a TemplateRef is used as the content or when the modal is closed, will return undefined.

    Returns T

  • get dismissed(): Observable<any>
  • The observable that emits when the modal is dismissed via the .dismiss() method.

    It will emit the reason passed to the .dismissed() method by the user, or one of the internal reasons like backdrop click or ESC key press.

    Returns Observable<any>

    8.0.0

  • get hidden(): Observable<void>
  • The observable that emits when both modal window and backdrop are closed and animations were finished. At this point modal and backdrop elements will be removed from the DOM tree.

    This observable will be completed after emitting.

    Returns Observable<void>

    8.0.0

  • get shown(): Observable<void>
  • The observable that emits when modal is fully visible and animation was finished. Modal DOM element is always available synchronously after calling 'modal.open()' service.

    This observable will be completed after emitting. It will not emit, if modal is closed before open animation is finished.

    Returns Observable<void>

    8.0.0

Methods

  • Closes the modal with an optional result value.

    The NgbMobalRef.result promise will be resolved with the provided value.

    Parameters

    • Optionalresult: any

    Returns void

  • Dismisses the modal with an optional reason value.

    The NgbModalRef.result promise will be rejected with the provided value.

    Parameters

    • Optionalreason: any

    Returns void

  • Updates options of an opened modal.

    Parameters

    • options: NgbModalUpdatableOptions

    Returns void

    14.2.0