Like it or not, building a component this way would let Angular go full Super Saiyan.
Why?
Because unlike decorators, functions give you full control over typing.
And why does that matter?
With this approach, I can understand all of a component’s dependencies just by looking at its type.
I can clearly see that ApiService and Router are direct dependencies of the component.
But there can also be indirect dependencies coming from things like JsonPipe or StatusComponent.
And why is that interesting?
Because it massively simplifies test setup—especially in large, messy applications.
This change would also enable strongly typed routes (which already exist), along with type-safe inputs bound to route parameters.
It would even allow you to catch missing service injections at compile time.
And that would be incredible.
Angular’s DI system is already excellent—this would take it to the next level.
And the best part? All of these benefits would only require minimal changes.
We’d still write almost the same code as before: metadata as the first argument (equivalent to the decorator),
and a function as the second argument that receives inputs and returns what’s used in the template.
And no—decorators simply can’t go that far.
This approach has already shown its limits with TypeScript.
Angular has always been seen as a professional framework for serious projects.
it’s time to fix its biggest weakness.
Follow me on LinkedIn for an Angular content.
👉 Romain Geffrault

Top comments (0)