Первый в конструкторе:
import { MatDialog} from '@angular/material';
import { YOUR COMPONENT YOU NEED TO RENDER IN MAT POPUP } from 'COMPONENT PATH HERE';
Внутри конструктора класса:
constructor(public dialog: MatDialog) { }
Когда вы хотите передать данные:
openViewdDialog(data: any): void {
const dialogRef = this.dialog.open(YOUR COMPONENT WHICH NEED TO BE OPENED, {
width: '850px', // What ever the width of popup
data: { data } //data you want to pass to the popup
});
dialogRef.afterClosed().subscribe(result => {
// Whatever you need to do when the popup is closed
});
}