import { Component, OnInit, Inject } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; @Component({ selector: 'app-new-season-dialog', templateUrl: './new-season-dialog.component.html', styleUrls: ['./new-season-dialog.component.less'] }) export class NewSeasonDialogComponent { constructor( public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any ) { } ngOnInit(): void { } onCancelClick(): void { this.dialogRef.close(); } onSaveClick(): void { // You can perform any actions here before closing the dialog this.dialogRef.close(this.data); } }