Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
nicoburns
on May 29, 2019
|
parent
|
context
|
favorite
| on:
Angular v8.0
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.
bradstewart
on May 29, 2019
[–]
Unless you care about the scope/lifecycle of the service. Or want to easily replace its implementation in different contexts (like tests).
ng12
on May 29, 2019
|
parent
[–]
Most test frameworks allow you to stub imports. DI is just one of the many wheels Angular has reinvented.
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: