carbon-components-angular
Version:
Next generation components
57 lines (56 loc) • 1.66 kB
TypeScript
import { BaseModal } from "./base-modal.class";
/**
* Component to create standard modals for presenting content or asking for user's input.
* It can show as a passive modal showing only text or show as a transactional modal with
* multiple buttons for different actions for the user to choose from.
*
* Using a modal in your application requires `ibm-modal-placeholder` which would generally be
* placed near the end of your app component template (app.component.ts or app.component.html) as:
*
* ```html
* <ibm-modal-placeholder></ibm-modal-placeholder>
* ```
*
* Example of opening the modal:
*
* ```typescript
* \@Component({
* selector: "app-modal-demo",
* template: `
* <button class="btn--primary" (click)="openModal()">Open modal</button>
* <ibm-modal-placeholder></ibm-modal-placeholder>`
* })
* export class ModalDemo {
* openModal() {
* this.modalService.show({
* modalType: "default",
* modalLabel: "optional header text",
* modalTitle: "Modal modalTitle",
* text: "Modal text",
* buttons: [{
* text: "Button text",
* type: "primary",
* click: clickFunction
* }]
* });
* }
* }
* ```
*
* @export
* @class AlertModal
*/
export declare class AlertModal extends BaseModal {
modalType: string;
modalLabel: string;
modalTitle: string;
modalContent: string;
buttons: any[];
/**
* Creates an instance of `AlertModal`.
* @param {ModalService} modalService
* @memberof AlertModal
*/
constructor(modalType: string, modalLabel: string, modalTitle: string, modalContent: string, buttons?: any[]);
buttonClicked(buttonIndex: any): void;
}