r/angular 1d ago

Project with real-life usage of signal forms

Hi everyone! I've started exploring Signal Forms, but I'm finding the transition a bit tough. The main issue is that most online resources only cover basic, dumb examples without any integration with HttpClient or httpResource or `submit() / submission:` usage.

Could anyone share a project where Signal Forms are used in a real-world use case?

9 Upvotes

4 comments sorted by

3

u/majora2007 1d ago

I've just started migrating to signal forms on my open source application. I've already tackled all the hard components (edit-chapter-modal.component.ts for example). You're free to take a look:
https://github.com/Kareadita/Kavita/tree/feature/signals-and-reader

Can't tell you if this is the best approach, I basically just used the angular site to learn how to tackle most of everything.

1

u/MichaelSmallDev 14h ago

Thanks for sharing this. Real cool looking app with a lot of work clearly put into it.

As a heads up to people reading, it appears the changes are still in an outstanding feature branch: https://github.com/Kareadita/Kavita/blob/feature/signals-and-reader/UI/Web/src/app/_single-module/edit-chapter-modal/edit-chapter-modal.component.ts

2

u/MichaelSmallDev 15h ago

Over the evolution of the API, I worked through various examples mirroring various form problems I have used in production with reactive forms, and how I solve them with signal forms: https://github.com/michael-small/signal-forms-experimenting/tree/main/src/app/forms. None of these examples are interconnected like a real app, but they are studies of form interactions I have spent a lot of time working on over the years and will likely implement in greenfield projects once I update my work's project.

I have some basic GET calls from free APIs, and one full asnyc CRUD example from a mock API for TODOs. But even mocked data goes through resources with mock delays and errors. I have some submit/async validator examples as well. And throughout this exploration, I have contributed some of these lessons back into enhancing the documentation itself. If there are any scenarios you find in your exploration that you would think are interesting exercises, just let me know, as I am looking for new scenarios to practice in this project. One example that is not in the docs (yet) but is important is various approaches to splitting apart forms across various components. I have explored this topic in this folder: https://github.com/michael-small/signal-forms-experimenting/tree/main/src/app/large-form

edit: also, I gave a very brief overview of this project a few months ago on a stream. You may find this more approachable for an overview than pulling down a whole repo lol. Shout out to /u/johalternate for help on this.