Skip to content

Instantly share code, notes, and snippets.

@jtcrowson
Last active February 7, 2019 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtcrowson/44286b49a7858fd5fbef04453376b27d to your computer and use it in GitHub Desktop.
Save jtcrowson/44286b49a7858fd5fbef04453376b27d to your computer and use it in GitHub Desktop.
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