Hacker News new | ask | show | jobs
by nicoburns 2572 days ago
I agree that the pattern of "services" is a good one. But you don't really need Angular's DI for this in javascript. You can just use an ES6 module.
1 comments

Unless you care about the scope/lifecycle of the service. Or want to easily replace its implementation in different contexts (like tests).
Most test frameworks allow you to stub imports. DI is just one of the many wheels Angular has reinvented.