modal.d.ts 1.6 KB

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