mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
parent
c0cb9f8c14
commit
74dd2f7980
2 changed files with 11 additions and 1 deletions
|
|
@ -581,7 +581,7 @@ function $CompileProvider($provide) {
|
|||
if (directiveValue == 'element') {
|
||||
$template = jqLite(compileNode);
|
||||
$compileNode = templateAttrs.$$element =
|
||||
jqLite('<!-- ' + directiveName + ': ' + templateAttrs[directiveName] + ' -->');
|
||||
jqLite(document.createComment(' ' + directiveName + ': ' + templateAttrs[directiveName] + ' '));
|
||||
compileNode = $compileNode[0];
|
||||
replaceWith($rootElement, jqLite($template[0]), compileNode);
|
||||
childTranscludeFn = compile($template, transcludeFn, terminalPriority);
|
||||
|
|
|
|||
|
|
@ -2241,5 +2241,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|');
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue