News for hackers. Stuff that matters.
Re:Angular 2.0 by jeswin on Tuesday March 18, 2014 @07:36AM (#7421314)
Nothing, for swapping things out. :)

In my test initialization, I'd probably just replace the value of "ns.someService" worldwide with a mock.

Re:Angular 2.0 by nocoment on Tuesday March 18, 2014 @02:11PM (#7423800)
> just replace the value of "ns.someService" worldwide with a mock.

Having a window-wide namespace might make sense in the test, but it is pretty risky/limiting if you are writing a component that should be reused in contexts you don't fully control. There are other ways around that besides DI, but they will probably have similar trade-offs in safety EOU, etc.