@browninglogic/ng-modal
Version:
A simple, lightweight interface for creating layered modal dialogs in Angular 6+
27 lines (26 loc) • 1.19 kB
TypeScript
import { EventEmitter } from '@angular/core';
import { ModalWindowComponent } from '../components/modal-window.component';
/**
* Maintains the indices of all active modal windows and reports index
* changes to the relevant modals so that each modal can layer itself
* accordingly with the correct z-index.
*/
export declare class ModalManagerService {
/** Informs subscribers when the index of a modal on the stack changes */
modalIndexChanged: EventEmitter<[ModalWindowComponent, number]>;
/** Maintains the currently-displayed modal windows in order */
private activeModals;
/** Starting point for the z-index of the layered modal windows */
startingZIndex: number;
/**
* Pushes the provided modal to the top of the stack, if it's not already there, and
* returns its index so that the component knows where to place itself via z-index
* @param modal A reference to the the modal component instance that we want to register
*/
push(modal: ModalWindowComponent): number;
/**
* Removes the specified modal, if it exists.
* @param modal The modal to remove
*/
removeModal(modal: ModalWindowComponent): void;
}