Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit b71a500

Browse files
committed
fix(tagging compiler): Empty transclusions
1 parent a099905 commit b71a500

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/core_dom/tagging_compiler.dart

Lines changed: 1 addition & 2 deletions
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 = parentElementBinderOffset;
53+
int taggedElementBinderIndex = -1;
5454
if (elementBinder.hasDirectivesOrEvents || elementBinder.hasTemplate) {
5555
taggedElementBinder = _addBinder(elementBinders,
5656
new TaggedElementBinder(elementBinder, parentElementBinderOffset));
@@ -64,7 +64,6 @@ class TaggingCompiler implements Compiler {
6464
if (elementBinder.shouldCompileChildren) {
6565
if (domCursor.descend()) {
6666
templateCursor.descend();
67-
6867
_compileView(domCursor, templateCursor, null, directives,
6968
taggedElementBinderIndex, taggedElementBinder, elementBinders);
7069

test/core_dom/compiler_spec.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ void main() {
9292
expect(element.html()).toEqual('<!--ANCHOR: [ng-repeat]=item in items-->');
9393
}));
9494

95+
it('should compile a repeater as a child', () {
96+
var element = $(_.compile(
97+
'<div ng-show="true">' +
98+
'<span ng-repeat="r in [1, 2]">{{r}}</span>' +
99+
'</div>'));
100+
_.rootScope.apply();
101+
expect(element.text()).toEqual('12');
102+
});
103+
95104
it('should compile repeater with children', inject((Compiler $compile) {
96105
var element = $(_.compile('<div><div ng-repeat="item in items"><div ng-bind="item"></div></div></div>'));
97106

0 commit comments

Comments
 (0)