Why is inject() better than constructor?
The inject() function was introduced with Angular 14, as an alternative to declaration of dependencies via providers property and via passing them into the constructor. Nowadays it is widely preferred to use inject() instead of constructor. In this article we will discover the benefits that support the argument that using inject() is better and why you should use it. - https://angular.love/why-is-inject-better-than-constructor
#angular
Post #9782
1.94K