philippd/angular-deferred-bootstrap — pull request #11 by Shepless (2014-05-19 20:43:53+00:00)
Title: Added the ability to specific a custom module to create the injector

I have made a few alterations that allow the config to take an optional ```injectorModules``` member. This will allow users to decide which module the deferred bootstrap should use and allows the injection of custom services.

I personally have a use case where I want to use one of my existing services to get configuration at bootstrap time, however this service is also used in other areas of the app, saving me from duplicating code. An example is below:

```js
deferredBootstrapper.bootstrap({
element: document.body,
module: 'myApp',
injectorModules: 'myApp.settings',
resolve: {
SETTINGS: ['SettingsService', function (SettingsService) {
return SettingsService.get('/settings');
}]
}
});
```

The ```injectorModules``` option can also take an array of modules so if you have multiple services spread across different modules you can also inject them:

```js
deferredBootstrapper.bootstrap({
element: document.body,
module: 'myApp',
injectorModules: ['myApp.settings', 'myApp.foo']
resolve: {
SETTINGS: ['SettingsService', function (SettingsService) {
return SettingsService.get('/settings');
}],
FOO: ['FooService', function (FooService) {
return FooService.get('/foo');
}]
}
});
```

As I mentioned previously this is a completely optional config member and if not included does not impact existing functionality.

You may also notice that this change uses the ```injector``` to instantiate the ```resolveFunction```. This gives the added benefit of being able to specify dependency injection in the various ways angular itself allows, for example:

```js
resolve: function($http) {}
```

```js
resolve: ['$http', function($http) {}]
```

Which in turn allows this bootstrap code to also be minified, something that is not currently available.

I have included two new units tests to cover this new functionality. I hope it meets the requirements.

Cheers.