fix(di): hostInjector and viewInjector support nested arrays

This commit is contained in:
vsavkin
2015-07-09 11:40:09 -07:00
parent b716046b97
commit 0ed5dd0d7b
6 changed files with 24 additions and 12 deletions

View File

@ -25,7 +25,6 @@ import {
AbstractBindingError,
CyclicDependencyError,
resolveForwardRef,
resolveBindings,
VisibilityMetadata,
DependencyProvider,
self
@ -240,9 +239,9 @@ export class DirectiveBinding extends ResolvedBinding {
var rb = binding.resolve();
var deps = ListWrapper.map(rb.dependencies, DirectiveDependency.createFrom);
var resolvedHostInjectables =
isPresent(ann.hostInjector) ? resolveBindings(ann.hostInjector) : [];
isPresent(ann.hostInjector) ? Injector.resolve(ann.hostInjector) : [];
var resolvedViewInjectables = ann instanceof Component && isPresent(ann.viewInjector) ?
resolveBindings(ann.viewInjector) :
Injector.resolve(ann.viewInjector) :
[];
var metadata = DirectiveMetadata.create({
id: stringify(rb.key.token),

View File

@ -364,7 +364,6 @@ function _createProtoElementInjector(binderIndex, parentPeiWithDistance, renderE
if (directiveBindings.length > 0 || hasVariables) {
var directiveVariableBindings =
createDirectiveVariableBindings(renderElementBinder, directiveBindings);
protoElementInjector =
ProtoElementInjector.create(parentPeiWithDistance.protoElementInjector, binderIndex,
directiveBindings, isPresent(componentDirectiveBinding),