diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js index 9e5ad2f5a6ad..d04603037e17 100644 --- a/src/ng/directive/ngRepeat.js +++ b/src/ng/directive/ngRepeat.js @@ -379,7 +379,9 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) { if (!block.startNode) { linker(childScope, function(clone) { - clone[clone.length++] = document.createComment(' end ngRepeat: ' + expression + ' '); + if(childScope.$last) { + clone[clone.length++] = document.createComment(' end ngRepeat: ' + expression + ' '); + } $animate.enter(clone, null, jqLite(previousNode)); previousNode = clone; block.scope = childScope; diff --git a/test/BinderSpec.js b/test/BinderSpec.js index b553c68dcfd0..b8b95f31bd3a 100644 --- a/test/BinderSpec.js +++ b/test/BinderSpec.js @@ -96,7 +96,6 @@ describe('Binder', function() { ''); @@ -107,9 +106,7 @@ describe('Binder', function() { ''); @@ -120,7 +117,6 @@ describe('Binder', function() { ''); @@ -231,15 +227,12 @@ describe('Binder', function() { '
'+ '' + ''+ - '' + ''+ '' + '
'+ - '' + '
'+ '' + ''+ - '' + ''+ '' + '
' + @@ -322,14 +315,13 @@ describe('Binder', function() { $rootScope.$apply(); var d1 = jqLite(element[0].childNodes[1]); - var d2 = jqLite(element[0].childNodes[3]); + var d2 = jqLite(element[0].childNodes[2]); expect(d1.hasClass('o')).toBeTruthy(); expect(d2.hasClass('e')).toBeTruthy(); expect(sortedHtml(element)).toBe( '
' + '' + '
' + - '' + '
' + '' + '
'); @@ -437,7 +429,6 @@ describe('Binder', function() { ''); diff --git a/test/ng/directive/ngClassSpec.js b/test/ng/directive/ngClassSpec.js index a788e45255b5..0db321cb7386 100644 --- a/test/ng/directive/ngClassSpec.js +++ b/test/ng/directive/ngClassSpec.js @@ -166,7 +166,7 @@ describe('ngClass', function() { element = $compile('