Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I switched to angular explicitly for the dependency injection. Registering a singleton so it can be passed in to other functions and mocked out easily in tests is something I find extremely useful.

Whether the framework should provide three different ways to register the object is another matter (a design decision along the harder-to-grok vs accommodate-variety axis) but, frankly, if you don't like factories, don't use them.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: