fix($compile): safely create transclude comment nodes

Closes #1740
This commit is contained in:
Igor Minar
2013-01-09 22:07:33 -08:00
parent 98489a1d0c
commit 2ba458387d
2 changed files with 11 additions and 1 deletions

View File

@@ -2222,5 +2222,15 @@ describe('$compile', function() {
expect(nodeName_(comment)).toBe('#comment');
});
});
it('should safely create transclude comment node and not break with "-->"',
inject(function($rootScope) {
// see: https://github.com/angular/angular.js/issues/1740
element = $compile('<ul><li ng-repeat="item in [\'-->\', \'x\']">{{item}}|</li></ul>')($rootScope);
$rootScope.$digest();
expect(element.text()).toBe('-->|x|');
}));
});
});