Last active
February 7, 2019 05:12
-
-
Save jtcrowson/44286b49a7858fd5fbef04453376b27d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { MatDialog } from '@angular/material'; | |
@Component({ | |
selector: 'dialog-overview-example', | |
template: `<a (click)="openDialog()">Open Dialog</a>` | |
}) | |
export class DialogOverviewExample { | |
constructor(public dialog: MatDialog) {} | |
openDialog(): void { | |
const dialogRef = this.dialog.open(DialogOverviewExampleDialog, { | |
width: '250px', | |
data: {name: 'yourName', animal: 'animal'} | |
}); | |
dialogRef.afterClosed().subscribe(result => { | |
console.log('The dialog was closed'); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment