Skip to content

Instantly share code, notes, and snippets.

Last active August 12, 2022 18:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
dialog parent example from route
selector: 'dialog-parent-example',
templateUrl: 'dialog-parent-example.html',
styleUrls: ['dialog-parent-example.css'],
export class DialogParentExample {
routeQueryParams: Subscription;
constructor(public dialog: MatDialog, private route: ActivatedRoute) {}
ngOnInit() {
this.routeQueryParams = route.queryParams.subscribe(params => {
if (params['dialog']) {
ngOnDestroy() {
openDialog(): void {
const dialogRef =, {
width: '250px',
data: {name: 'Sample Dialog'}
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed', result);
Copy link

mneige commented Aug 12, 2022

Cannot find name 'route'. Did you mean the instance member 'this.route'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment