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

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.

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



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vlad Gheorghita

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