Why Angular 14’s new inject() function is so amazing?

Vlad Gheorghita
6 min readAug 10, 2022

As you have probably already read, Angular 14 shipped some very interesting features: typed forms (which can still be improved, see how here), standalone components, and, the focus of this article, the ability to use the inject( ) function during the so-called constructor phase.

Let’s break the above sentence in 2.

What is the inject() function

The inject() function takes an InjectionToken as a parameter and returns the value for that InjectionToken from the currently…

--

--

Vlad Gheorghita

And the Internet said: let there be web development. Find me on twitter @browsepedia