Is it possible to pass the ngSubmit function as a parameter? I created a component that receives an Id and the name of the ngSubmit function, but how do I put this parameter on the template?
I have a component called validation-form
validation-form.component.html
<form [id]="formId" method="post" novalidate [(ngSubmit)]="">
<ng-content></ng-content>
</form>
My validation-form.component.ts has
@Input() formId: string;
@Input() submit: string;
I pass this values like this
<validation-form formId="ResetPasswordForm" submit="resetPassword()">
</validation-form>
I want to put the value of @Input() submit: string; to to the (ngSubmit). How can i do this?
<validation-form ... [submit]="resetPassword">). The function will not be accessible by name outside of your component that is using<validation-form>. - Daniel W Strimpel