Dialog Module Name: DialogModule

Module Name: DialogModule

Dialog is an overlay component service that can be used as message, confirmation, alert and to show an error exception.

Showcase
Show Dialog Info
Show Dialog Confirmation
Show Dialog Alert
Show Dialog Error
Making it Work

Step One

Inject the DialogService in your constructor.
constructor( public dialogService: DialogService ) {}

Final Step

Create an function to call the dialog type method of the DialogService. For example:
showDialogConfirmation() {
    this.dialogService.confirmation( 'Are you sure ?', ({
      isYes: (yes) => console.log('yes', yes),
      isNo: (no) => console.log('no', no)
    }));
  }
The others methods types are the same template
showDialogInfo() {
    this.dialogService.info( 'This is an Info Dialog' ).then( value => {
      console.log( 'Return', value );
  } );
Dialog Results
export enum ModalResult {
      MRFREE = -1,
      MRCUSTOM = 0,
      MROK = 1,
      MRCANCEL = 2,
      MRABORT = 3,
      MRRETRY = 4,
      MRIGNORE = 5,
      MRYES = 6,
      MRNO = 7,
      MRCLOSE = 8,
  }
Methods
NameParametersDescription
alert
message: string : The message itself
options: AlertOptions : Options of type AlertOptions
mdOptions: ModalOptions : Options of modal container
Promisse : returns a promisse with dialog result
Show a alert dialog message.
confirmation
message : The message itself
callback : Callback of type ConfirmCallback, returned after closed.
options: ConfirmationOptions : Options of type ConfirmationOptions
mdOptions: ModalOptions : Options of modal container
Show a confirmation dialog with two buttons.
error
message: string : The message itself
options: ErrorOptions : Options of type ErrorOptions
mdOptions: ModalOptions : Options of modal container
Promisse : returns a promisse with dialog result
Show a error dialog message.
info
message: string : The message itself
options: InfoOptions : Options of type InfoOptions
mdOptions: ModalOptions : Options of modal container
Promisse : returns a promisse with dialog result
Show a information dialog message.
Properties
NameTypeDefaultDescriptionOptions
colorstring#53C68CColor of window dialog header Hex | RGBA
draggablebooleantrueControl if window dialog is draggrable or not true | false
heightstring500pxHeight of window dialog px | % | em
iconstringnullIcon of Window ion-printer | fa fa-home | any
maximizablebooleantrueControl if window dialog is maximizable or not true | false
minimizablebooleantrueControl if window dialog is minimizable or not true | false
titlestringMy ModalTitle of window dialog any text
widthstring500pxWidth of window dialog px | % | em
Events

All Modal (tl-modal) Events can be used on this component.