UNPKG

1.63 kBTypeScriptView Raw
1import { NgbModalOptions } from './modal-config';
2import { NgbModalRef } from './modal-ref';
3import * as i0 from "@angular/core";
4/**
5 * A service for opening modal windows.
6 *
7 * Creating a modal is straightforward: create a component or a template and pass it as an argument to
8 * the `.open()` method.
9 */
10export declare class NgbModal {
11 private _injector;
12 private _modalStack;
13 private _config;
14 /**
15 * Opens a new modal window with the specified content and supplied options.
16 *
17 * Content can be provided as a `TemplateRef` or a component type. If you pass a component type as content,
18 * then instances of those components can be injected with an instance of the `NgbActiveModal` class. You can then
19 * use `NgbActiveModal` methods to close / dismiss modals from "inside" of your component.
20 *
21 * Also see the [`NgbModalOptions`](#/components/modal/api#NgbModalOptions) for the list of supported options.
22 */
23 open(content: any, options?: NgbModalOptions): NgbModalRef;
24 /**
25 * Returns an observable that holds the active modal instances.
26 */
27 get activeInstances(): import("@angular/core").EventEmitter<NgbModalRef[]>;
28 /**
29 * Dismisses all currently displayed modal windows with the supplied reason.
30 *
31 * @since 3.1.0
32 */
33 dismissAll(reason?: any): void;
34 /**
35 * Indicates if there are currently any open modal windows in the application.
36 *
37 * @since 3.3.0
38 */
39 hasOpenModals(): boolean;
40 static ɵfac: i0.ɵɵFactoryDeclaration<NgbModal, never>;
41 static ɵprov: i0.ɵɵInjectableDeclaration<NgbModal>;
42}