md-dialogs
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Material Dialogs Helper Module

This is to simplify MatDialogs from @angular/material package but wrapping it in a service.

Currently it supports:

  • Confirm Dialog

Try it out here: https://stackblitz.com/edit/md-dialogs-helper

Getting started

  1. Install from npm npm i md-dialogs -s
  2. Import the module MdDialogsHelperModule to your own module
  import { MdDialogsHelperModule } from 'md-dialogs';

  @NgModule({
    declarations: [
      ...
    ],
    imports: [
      ...
      MdDialogsHelperModule,
    ]
  })
  export class AppModule { }

  1. Inject the MdDialogsHelperService service
  2. Call it like the following:
  import { MdDialogsHelperService } from 'md-dialogs';
  constructor(private dialogs: MdDialogsHelperService) {}

  public openConfirmDialog() {
    this.dialogs
      .confirm('Confirm Dialog')
      .subscribe((result) => {
        /*
          result will be true or false
          depending on user clicking OK or cancelling
        */
      });
  }

Readme

Keywords

none

Package Sidebar

Install

npm i md-dialogs

Weekly Downloads

7

Version

2.0.0

License

MIT

Unpacked Size

54.1 kB

Total Files

23

Last publish

Collaborators

  • tariknz