diff --git a/modules/angular2/src/core/compiler/element_injector.ts b/modules/angular2/src/core/compiler/element_injector.ts index b01a3db79f..eb8f82dce1 100644 --- a/modules/angular2/src/core/compiler/element_injector.ts +++ b/modules/angular2/src/core/compiler/element_injector.ts @@ -714,6 +714,10 @@ export class ElementInjector extends TreeNode implements Depend } addDirectivesMatchingQuery(query: Query, list: any[]): void { + var templateRef = this._preBuiltObjects.templateRef; + if (query.selector === TemplateRef && isPresent(templateRef)) { + list.push(templateRef); + } this._strategy.addDirectivesMatchingQuery(query, list); } diff --git a/modules/angular2/src/core/compiler/proto_view_factory.ts b/modules/angular2/src/core/compiler/proto_view_factory.ts index 56b912ac06..a510865afe 100644 --- a/modules/angular2/src/core/compiler/proto_view_factory.ts +++ b/modules/angular2/src/core/compiler/proto_view_factory.ts @@ -366,10 +366,13 @@ function _createProtoElementInjector(binderIndex, parentPeiWithDistance, renderE componentDirectiveBinding, directiveBindings) { var protoElementInjector = null; // Create a protoElementInjector for any element that either has bindings *or* has one - // or more var- defined. Elements with a var- defined need a their own element injector - // so that, when hydrating, $implicit can be set to the element. + // or more var- defined *or* for