import {Component} from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; /** * @title Dialog with header, scrollable content and actions */ @Component({ selector: 'dialog-content-example', templateUrl: 'dialog-content-example.html', styleUrls: ['dialog-content-example.css'], }) export class DialogContentExample { constructor(public dialog: MatDialog) {} openDialog() { const dialogRef = this.dialog.open(DialogContentExampleDialog); dialogRef.afterClosed().subscribe(result => { console.log(`Dialog result: ${result}`); }); } } @Component({ selector: 'dialog-content-example-dialog', templateUrl: 'dialog-content-example-dialog.html', }) export class DialogContentExampleDialog {}