refactor(core): separate reflective injector from Injector interface

BREAKING CHANGE:
- Injector was renamed into `ReflectiveInjector`,
  as `Injector` is only an abstract class with one method on it
- `Injector.getOptional()` was changed into `Injector.get(token, notFoundValue)`
  to make implementing injectors simpler
- `ViewContainerRef.createComponent` now takes an `Injector`
  instead of `ResolvedProviders`. If a reflective injector
  should be used, create one before calling this method.
  (e.g. via `ReflectiveInjector.resolveAndCreate(…)`.
This commit is contained in:
Tobias Bosch
2016-04-14 12:35:24 -07:00
parent efbd446d18
commit 0a7d10ba55
46 changed files with 1790 additions and 1719 deletions

View File

@ -22,7 +22,7 @@ import {
Reporter,
bind,
provide,
Injector,
ReflectiveInjector,
Options,
MeasureValues
} from 'benchpress/common';
@ -65,7 +65,7 @@ export function main() {
bindings.push(bind(Options.PREPARE).toValue(prepare));
}
sampler = Injector.resolveAndCreate(bindings).get(Sampler);
sampler = ReflectiveInjector.resolveAndCreate(bindings).get(Sampler);
}
it('should call the prepare and execute callbacks using WebDriverAdapter.waitFor',