Hi
In below code i want when user clicks Delete it should ask for confirmation in Modal Form.
I don't want to use confirm()
Action
Thanks
Hi
In below code i want when user clicks Delete it should ask for confirmation in Modal Form.
I don't want to use confirm()
Action
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question.
Jayraj ChhayaPosted Jun 5, 2024, 9:19 AM
To achieve this functionality without using the
confirm()function, you can create a custom confirmation modal using Angular Material Dialog. Here's a basic implementation:Implement the confirmation dialog component with the necessary content and buttons for confirmation.
In your component where the delete button is located, inject the
MatDialogservice and open the confirmation dialog when the delete button is clicked:openConfirmationDialog()function when the delete button is clicked: