diff --git a/angularFiles.js b/angularFiles.js index 02bdf3a1d062..47f18961f736 100644 --- a/angularFiles.js +++ b/angularFiles.js @@ -79,7 +79,6 @@ angularFiles = { 'src/ngScenario/Describe.js', 'src/ngScenario/Future.js', 'src/ngScenario/ObjectModel.js', - 'src/ngScenario/Describe.js', 'src/ngScenario/Runner.js', 'src/ngScenario/SpecRunner.js', 'src/ngScenario/dsl.js', diff --git a/src/ng/compile.js b/src/ng/compile.js index 5026283ef516..29d66da577f9 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -581,7 +581,7 @@ function $CompileProvider($provide) { if (directiveValue == 'element') { $template = jqLite(compileNode); $compileNode = templateAttrs.$$element = - jqLite(''); + jqLite(document.createComment(' ' + directiveName + ': ' + templateAttrs[directiveName] + ' ')); compileNode = $compileNode[0]; replaceWith($rootElement, jqLite($template[0]), compileNode); childTranscludeFn = compile($template, transcludeFn, terminalPriority); diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 5b644af9f75c..927a4ef77781 100644 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -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('