import { MatDialogRef } from '@angular/material'; import { MAT_DIALOG_DATA } from '@angular/material'; import { Component, OnInit, Inject } from '@angular/core'; @Component({ selector: 'app-yes-no-popup', templateUrl: './yes-no-popup.component.html', styleUrls: ['./yes-no-popup.component.css'] }) export class YesNoPopupComponent implements OnInit { public title: string; public message: string; constructor(@Inject(MAT_DIALOG_DATA) public data: any, private MatDialogRef: MatDialogRef) { this.title = data.title; this.message = data.message; } ngOnInit() { } yes(){ this.MatDialogRef.close(true); } no(){ this.MatDialogRef.close(false); } }