The close function of the dialogRef is used to hide a Dialog. The dialogRef is injected to the component that is loaded by the dialog.