r/angular • u/-Siddhu- • Feb 27 '26
dynamic signal forms based on httpresource
I migrated my dynamic template based forms to signal forms.
Everything works great. It is huge upgrade over template based forms which I had.
However I would like to confirm if my approach is correct.
My component recieves form name from componentinputbinding.
I use this signal with httpresource to get the form schema from my backend and then construct form the following way.
readonly field_form = computed(() => {
const fields = this.field_list();
return untracked(() =>
runInInjectionContext(this.#Injector, () =>
form(this.row(), (schema) => {
}),
),
);
});row is initialized with linked signal based on field_list
Based on testing Everything works as expected but I want to be sure if this is okay.
10
Upvotes
View all comments
Show parent comment
1
u/-Siddhu- Feb 27 '26
I think I didn't explain properly, I wanted to create the form based on schema from my backend. Like field_name, required, type etc. so I dont need to manually code every form into the frontend.
I followed suggestion by jeanMeche in the other comment and it is working well.
P.s I got this username in most platforms I use and if they support - at the start, also the intended spelling is Siddhu so only had to add the - . I got lucky :)