From 2ba458387d19543b45c3bfdbe8db719d2c0f1f15 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 9 Jan 2013 22:07:33 -0800 Subject: fix($compile): safely create transclude comment nodes Closes #1740 --- test/ng/compileSpec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/ng/compileSpec.js') diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 75af0181..3a0e0289 100644 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -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('')($rootScope); + $rootScope.$digest(); + + expect(element.text()).toBe('-->|x|'); + })); }); }); -- cgit v1.2.3