Hi
When i click on Add Modal is not opening. Below is the Dynamic Table Component HTML.
openDialog($event:Event){
this.openModal.emit($event);
debugger;
}
Product Form
Thanks
Naimish MakwanaPosted Jul 9, 2024, 7:38 AM
It seems like you’re trying to open a modal dialog when the “Add” button is clicked, but it’s not working. Here are a few things you could check:
Event Emitter: Ensure that the
openModalevent emitter in your component is correctly emitting the event. You can check this by subscribing to theopenModalevent in the parent component and logging the event.Dialog Component: Make sure that the dialog component (the content inside
... ) is correctly set up to display as a modal. This usually involves using a service provided by your UI library (like MatDialog in Angular Material) to open the dialog.Dialog Service: Check if you have correctly injected the dialog service (like MatDialog) in your component and if you’re calling the appropriate method to open the dialog.
Button Click: Ensure that the click event on the button is correctly wired up to call the
openDialogmethod.If you’re using Angular Material, the code to open the dialog should look something like this:
In this example,
DialogContentComponentis the component that contains the dialog content. You would replace this with the component that contains your form.Remember to import
MatDialogModulein your module file.I hope this helps!
Thanks