Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tariknz/md-dialogs
https://github.com/tariknz/md-dialogs
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tariknz/md-dialogs
- Owner: tariknz
- Created: 2017-03-25T07:04:52.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-27T18:39:03.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T17:59:23.908Z (2 months ago)
- Language: TypeScript
- Size: 4.83 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Material Dialogs Helper Module
This is to simplify MatDialogs from @angular/material package but wrapping it in a service.
Currently it supports:
* Confirm DialogTry 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 { }```
3. Inject the `MdDialogsHelperService` service
4. 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
*/
});
}
```