From 81ad184d928625a97e15fd8baf3e6df21cf1efae Mon Sep 17 00:00:00 2001 From: James deBoer Date: Mon, 17 Mar 2014 16:04:07 -0700 Subject: [PATCH] fix(tagging compiler): ancestor injectables Conflicts: lib/core_dom/tagging_compiler.dart --- lib/core_dom/tagging_compiler.dart | 2 +- test/core_dom/compiler_spec.dart | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/core_dom/tagging_compiler.dart b/lib/core_dom/tagging_compiler.dart index 6d9f5b42b..5a578a779 100644 --- a/lib/core_dom/tagging_compiler.dart +++ b/lib/core_dom/tagging_compiler.dart @@ -50,7 +50,7 @@ class TaggingCompiler implements Compiler { if (node.nodeType == 1) { var taggedElementBinder = null; - int taggedElementBinderIndex = -1; + int taggedElementBinderIndex = parentElementBinderOffset; if (elementBinder.hasDirectivesOrEvents || elementBinder.hasTemplate) { taggedElementBinder = _addBinder(elementBinders, new TaggedElementBinder(elementBinder, parentElementBinderOffset)); diff --git a/test/core_dom/compiler_spec.dart b/test/core_dom/compiler_spec.dart index 86d110802..5b35e00f8 100644 --- a/test/core_dom/compiler_spec.dart +++ b/test/core_dom/compiler_spec.dart @@ -582,6 +582,19 @@ void main() { expect(element.text).toContain('my data'); }); + + it('should expose a ancestor controller to the scope of its children thru a undecorated element', (TestBed _) { + var element = _.compile( + '
' + '
' + '
{{ my_parent.data() }}
' + '
' + '
'); + + _.rootScope.apply(); + + expect(element.text).toContain('my data'); + }); });