Skip to content

Commit 81ad184

Browse files
committed
fix(tagging compiler): ancestor injectables
Conflicts: lib/core_dom/tagging_compiler.dart
1 parent 775ad57 commit 81ad184

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/core_dom/tagging_compiler.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class TaggingCompiler implements Compiler {
5050
if (node.nodeType == 1) {
5151

5252
var taggedElementBinder = null;
53-
int taggedElementBinderIndex = -1;
53+
int taggedElementBinderIndex = parentElementBinderOffset;
5454
if (elementBinder.hasDirectivesOrEvents || elementBinder.hasTemplate) {
5555
taggedElementBinder = _addBinder(elementBinders,
5656
new TaggedElementBinder(elementBinder, parentElementBinderOffset));

test/core_dom/compiler_spec.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,19 @@ void main() {
582582

583583
expect(element.text).toContain('my data');
584584
});
585+
586+
it('should expose a ancestor controller to the scope of its children thru a undecorated element', (TestBed _) {
587+
var element = _.compile(
588+
'<div my-parent-controller>'
589+
'<div>'
590+
'<div my-child-controller>{{ my_parent.data() }}</div>'
591+
'</div>'
592+
'</div>');
593+
594+
_.rootScope.apply();
595+
596+
expect(element.text).toContain('my data');
597+
});
585598
});
586599

587600

0 commit comments

Comments
 (0)