Angular · Senior · Question 65 of 75
What is the main benefit of using inject() over constructor parameters in base classes?
- ✓Correct answer: Subclasses don't need to repeat and forward the parent's constructor dependencies
- 2
inject()is faster at runtime - 3Constructor injection is removed
Explanation
Field initializers with inject() are inherited. It also works in functions like guards and resolvers.