DEV Community

Discussion on: Angular 8

Collapse
 
leobm profile image
Felix Wittmann • Edited

MatDialogConfig has a 'data' property.
Maybe this is the place for own properties ?

MatDialogConfig is the second parameter of the open method.

Edit:
When I understand it correctly.
In your own dialog component you can than later access the MatDialogRef in your constructor.

Edit:

This looks better:

you can inject the data.


import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
....

export class YourDialogComponent {
  constructor(
    @Inject(MAT_DIALOG_DATA) public data: any,
    public dialogRef: MatDialogRef<YourDialogComponent >
  ) {....}

Thread Thread
 
dreamcatcher8055 profile image
Akhil Ashok

Ok