I recently created a modal component using the following template structure:
<div class="header"></div>
<div class="body">
<ng-content></ng-content>
</div>
<div class="footer">
<button>Submit</button>
<button>Cancel</button>
</div>
Within the ng content, I inserted a template using a service like this:
<form #contactForm="ngForm" (ngSubmit)="onSubmit()">
/*some inputs */
<button type="submit">Submit</button>
</form>
I am faced with the challenge of triggering a submit action in my modal component when the button in the footer section is clicked. The button within the form is not needed (perhaps I should hide it?), but I am struggling to find a solution to make this work. How can I resolve this dilemma?