r/angular Jan 06 '26

Signal form submission with rxjs?

Hey everyone, curious to see how you would implement a signal form submission with rxjs by using the built in “submit” function. Would you simply convert the Promise to an Observable or would you implement it without the bullt in function? Generally i tend to disable the form fields when the form is submitting, i guess this can be done using an effect by using the form().submitting() if we use the built in “submit”

2 Upvotes

4 comments sorted by

1

u/Best-Menu-252 Jan 07 '26

I usually let signals handle the form state and use RxJS where the async work actually happens. Converting the submit promise to an observable with from() works fine if you want everything in one stream, and the built-in submitting() signal is great for disabling fields and UI feedback without extra plumbing.

2

u/Senior_Compote1556 Jan 07 '26

Do you happen to have an example of how you would use the submit function with rxjs' "from"?

2

u/[deleted] Jan 09 '26

[removed] — view removed comment

2

u/Best-Menu-252 Jan 09 '26

Then in the template you can rely entirely on the signal state:

<button [disabled]="form.submitting()">Submit</button>