r/Angular2 • u/TheRealToLazyToThink • May 22 '26
Why is SignalFormControl useless?
I thought SignalFormControl might be the answer to my problems today, but it turns out I'd be hard pressed to find a problem it actually fits. It might fit for some basis tutorial examples, but I can't imagine using it in a form complicated enough that you wouldn't just rewrite it to use signal forms directly.
https://angular.dev/api/forms/signals/compat/SignalFormControl
1) Problem 1: It's Untyped
It extends AbstractControl. Notice the lack of template paramaters there? That means it's a basically an untyped form control. We left those behind in v14.
Note the SignalFormControl itself is typed, and if you access it's value directly from there it will be typed, but if you're using a SignalFormControl, you are probably going to want to use it inside a FormGroup and that FormGroup's value and controls will have type any for your control.
I wonder why they did that? I wonder how much trouble it would cause if I cast it to FormControl<T>? I assume there must be a reason they extended AbstractControl without a type?
2) Problem 2: Disabling throws an exception.
And looking into it further, you can't disable a FormGroup that contains a SignalFormControl?!!
I understand not wanting to disable/enable it directly, that should be handled by the schema, but not being able to disable the parent form is a deal breaker. Our forms start disabled till their data is loaded, when the user lacks edit permissions, and when submitting the form.
To say I'm disappointed is an understatement.
I wonder why none of the articles I saw promoting it didn't mention any of this. Those are some pretty big downside. It's pretty much useless.
1
u/NotSureHowToNameIt May 22 '26
It works as a bridge between signals and old controls, so see it as a transition tool. IMO it's legacy code and not meant to stay
1
u/Illustrious_Matter_8 May 23 '26
If the user hasn't the rights he shouldn't be able to get there, security lives in your backend not in the front end. If the user isn't allowed API calls should detect such access..
2
u/Whole-Instruction508 May 22 '26
I share this sentiment. It's totally useless.
1
u/CallOk1729 May 22 '26
Dont tell me this 😔 I was looking forward to try it out soon. Really was waiting for this.
1
u/WordWithinTheWord May 22 '26
I understand WHY but I wish they’d just cut-line with the existing ReactiveForms. Rewrite the whole thing.
Every project I have to copy and paste in the same set of utility function to get basic QOL features.
1
u/Lower_Sale_7837 May 27 '26
About articles you mention, most of technical articles never tested the related feature in a real project, they just provide basic information.