@wobius/dialog

Easily add different types of dialogs to your Angular + Material project.

Stats

StarsIssuesVersionUpdatedCreatedSize
@wobius/dialog
6.0.23 years ago4 years agoMinified + gzip package size for @wobius/dialog in KB

Readme

Easily add different types of dialogs to your Angular + Material project.

Import the Module:

import { DialogModule } from '@wobius/dialog'

@NgModule({
    imports: [ DialogModule ]
})

Usage:

import { Component } from '@angular/core'
import { MatDialog } from '@angular/material/dialog'
import { DialogComponent } from '@wobius/dialog'

@Component({
    template: `
        <button (click)="onUserInput()">User Input</button><br>
        <button (click)="onConfirm()">Confirmation</button>
    `
})
export class MyComponent {
    constructor(private dialog:MatDialog) {}
    onUserInput() {
        let d = this.dialog.open(DialogComponent)
        d.componentInstance.title = "Enter Name"
        d.componentInstance.content = "Input Hint"
        d.afterClosed().subscribe(res => {
            console.log(res)
        })
    }
    onConfirm() {
        let d = this.dialog.open(DialogComponent)
        d.componentInstance.isConfirmation = true
        d.componentInstance.title = "Confirmation"
        d.componentInstance.content = "Are you sure you want to proceed?"
        d.afterClosed().subscribe(res => {
            console.log(res)
        })
    }
}

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.