angular/di.js — pull request #38 by petebacondarwin (2014-04-22 08:47:34+00:00)
Title: Overriding dependencies in child injectors

Consider the situation where a service, `A`, is defined in a `parent` injector but has a dependency on another service, `B`, which is provided in both the `parent` injector and a `child` injector, say as `parentB` and `childB` respectively.

If you get an instance of `A` from the `parent` then you should get `A(parentB)` but if you get the instance from the `child` injector then you want to get `A(childB)`.

This pull request implements this ability by passing through an `originalInjector` (it could be named something else such as `invokedInjector`), which is passes along whenever the injector looks for a dependency in its parent, so that the original injector is used to find parameter dependencies on any services it provides.

Partially closes #37