The close function is available through a dialogRef that is injected to the component loaded by the dialog.