import { Component } from '@angular/core' ; import { MatDialog } from '@angular/material' ; title @ Component ( { selector : 'dialog-content-example' , templateUrl : 'dialog-content-example.html' , styleUrls : [ 'dialog-content-example.css' ] , } ) export class DialogContentExample { constructor ( public dialog ) { } 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 { }