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

Commit

Permalink
fix(tagging compiler): Empty transclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
jbdeboer committed Mar 17, 2014
1 parent a099905 commit b71a500
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/core_dom/tagging_compiler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TaggingCompiler implements Compiler {
if (node.nodeType == 1) {

var taggedElementBinder = null;
int taggedElementBinderIndex = parentElementBinderOffset;
int taggedElementBinderIndex = -1;
if (elementBinder.hasDirectivesOrEvents || elementBinder.hasTemplate) {
taggedElementBinder = _addBinder(elementBinders,
new TaggedElementBinder(elementBinder, parentElementBinderOffset));
Expand All @@ -64,7 +64,6 @@ class TaggingCompiler implements Compiler {
if (elementBinder.shouldCompileChildren) {
if (domCursor.descend()) {
templateCursor.descend();

_compileView(domCursor, templateCursor, null, directives,
taggedElementBinderIndex, taggedElementBinder, elementBinders);

Expand Down
9 changes: 9 additions & 0 deletions test/core_dom/compiler_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ void main() {
expect(element.html()).toEqual('<!--ANCHOR: [ng-repeat]=item in items-->');
}));

it('should compile a repeater as a child', () {
var element = $(_.compile(
'<div ng-show="true">' +
'<span ng-repeat="r in [1, 2]">{{r}}</span>' +
'</div>'));
_.rootScope.apply();
expect(element.text()).toEqual('12');
});

it('should compile repeater with children', inject((Compiler $compile) {
var element = $(_.compile('<div><div ng-repeat="item in items"><div ng-bind="item"></div></div></div>'));

Expand Down

0 comments on commit b71a500

Please sign in to comment.