feat(di): provide two ways to create an injector, resolved and unresolved

Add two factory static functions to Injector: resolveAndCreate and
fromResolvedBindings.

We want to avoid resolution and flattening every time we create a new
injector. This commit allows the user to cache resolved bindings and
reuse them.
This commit is contained in:
Yegor Jbanov
2015-04-13 15:06:43 -07:00
parent 6c8398df9b
commit 4a961f4ecb
24 changed files with 160 additions and 127 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ export class AppView {
if (isPresent(componentDirective)) {
var injectables = componentDirective.annotation.injectables;
if (isPresent(injectables))
shadowDomAppInjector = appInjector.createChild(injectables);
shadowDomAppInjector = appInjector.resolveAndCreateChild(injectables);
else {
shadowDomAppInjector = appInjector;
}