In the method that opens the dialog pass in the following configuration option disableclose as the second parameter in matdialog open and set it to true.
Mat dialog close.
This is very easy to forget and the dialog will open it s just that then all dialog directives including mat dialog actions mat dialog title and mat dialog content will not work.
Export class appcomponent constructor private dialog.
If you want to control whether clicking it will close the dialog use disabled formisvalid as other answer states.
Solo para completar la respuesta.
In the method that opens the dialog pass in the following configuration option disableclose as the second parameter in matdialog open and set it to true.
How to implement an angular material dialog in angular application the matdialog service can be used to open modal dialogs with material mat dialog close attr added to a button makes the button close the dialog with ui component infrastructure and material design components for mobile and desktop angular web applications.
Sin embargo el valor asignado a mat dialog close no se ignora.
Matdialog opendialog this dialog open dialogcomponent disableclose.
We are going to cover many of the most common use cases that revolve around the angular material dialog such as.
Export class appcomponent constructor private dialog.
Matdialog opendialog this dialog open dialogcomponent disableclose.
Just to make the answer complete.
Mat dialog close cerrará su cuadro de diálogo si se hace clic sin importar el valor que le asigne.
Si desea controlar si al hacer clic en él se cerrará el cuadro de diálogo use disabled formisvalid como indica otra respuesta.
However the value assigned to mat dialog close is not ignored.
In this post we are going to go through a complete example of how to build a custom dialog using the angular material dialog component.