I am utilizing the dialog box feature of Angular Material2.
My goal is to send data to the component that opens within the dialog. This is how I trigger the dialog box when a button is clicked:
let dialogRef = this.dialog.open(DialogComponent, {
disableClose: true,
data :{'name':'Sunil'}
});
While going through the documentation, I noticed that there is a `data` property mentioned, but when I inspected the MdDialogConfig in my installed packages,
/**
* Configuration for opening a modal dialog with the MdDialog service.
*/
export declare class MdDialogConfig {
viewContainerRef?: ViewContainerRef;
/** The ARIA role of the dialog element. */
role?: DialogRole;
/** Whether the user can use escape or clicking outside to close a modal. */
disableClose?: boolean;
/** Width of the dialog. */
width?: string;
/** Height of the dialog. */
height?: string;
/** Position overrides. */
position?: DialogPosition;
}
there seems to be no `data` property available in the configuration class.
So, my question now is: How do I access the data that was passed to the opened component?