md-dialogs
v2.0.0
Published
This is to simplify MatDialogs from @angular/material package but wrapping it in a service.
Downloads
16
Readme
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
- Install from npm
npm i md-dialogs -s
- Import the module
MdDialogsHelperModule
to your own module
import { MdDialogsHelperModule } from 'md-dialogs';
@NgModule({
declarations: [
...
],
imports: [
...
MdDialogsHelperModule,
]
})
export class AppModule { }
- Inject the
MdDialogsHelperService
service - 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
*/
});
}