soundstep/infuse.js — pull request #2 by milkisevil (2014-05-20 17:32:21+00:00)
Title: Specifying dependencies with minified constructor args

It seems that there is no way to specify dependencies if your code is minified and your constructor's args resemble `(a,b,c)`.

So this PR proposes that we adopt a similar technique to the [AngularJS $inject property](https://docs.angularjs.org/api/auto/service/$injector#the-inject-property). I've opted for `inject` as opposed to `$inject`, as the `$` is an internal angular namespacing convention - not so relevant here.

This is a test case:

```
var FooClass = function(a){this.typeParam = a;};
FooClass.inject = ['type'];
injector.mapClass("name", FooClass);
injector.mapValue("type", "type");
var foo = injector.getValue("name");
expect(foo).not.toBeNull();
expect(foo).not.toBeUndefined();
expect(foo instanceof FooClass).toBeTruthy();
expect(foo.typeParam).toEqual("type");
```

As an aside, if you happen to be using TypeScript which is to be minified, `inject` can neatly be declared above your constructor using the `static` keyword.
```
export class FooClass
{
typeParam:MyType;
static inject = ['type'];
constructor( type:MyType )
{
this.typeParam = type;
}
}
```