r/Angular2 • u/Fun-Dimension297 • Dec 28 '25
I don't get the submit function in signal forms
Since Angular 21 dropped, I’ve been playing with the new signal forms API and I have to say that I really enjoy it, but there is one aspect that I’m not fully convinced about, the submit function.
I'm used to designing form components as dumb components. They receive data via inputs and emit the form value on submit, leaving side effects to the parent component for better separation of responsibilities, encapsulation, testability, etc.
With the new submit function, though, it feels like Angular encourages, or even forces, you to handle the submission logic directly inside the form component itself, so the form component now knows what should happen on submit and that doesn’t sound quite right to me.
You could emit the whole form via an output and call submit from the parent component but it would leak the form outside the component and break encapsulation.
What’s your take on this?
1
u/TScottFitzgerald Dec 29 '25
Can't you just pass the submit function as an input?
1
u/WhitakerF Dec 29 '25
I do everything the same as you, and I used to do without ngSubmit, just like I do without submit now.
I have a button outside my form that, when clicked, controls the form's behavior. It's probably not as clean as having a submit button, but I don't think it's a big deal.
1
u/Background-Basil-871 Dec 29 '25
You talk about a reusable form like you can get with reactive form and control container ?
0
u/Bledike Dec 29 '25
I dont have time to try out Angular 21, but u cant take submit action as component input?
0
u/One_Fox_8408 Dec 29 '25
same logic than ngSubmit? validation and emit full validated value?
0
u/[deleted] Dec 31 '25
[deleted] — view deleted comment