From b40e04b9deca2ab0eaf17dc71745342eca89302e Mon Sep 17 00:00:00 2001 From: Ivo Mirra Date: Mon, 2 May 2016 15:31:17 +0100 Subject: [PATCH 1/3] fix($compile): removing unnecessary white space When creating DOM commentary for ng-switch-when theres an unecessary white space at the end. --- src/ng/compile.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index 8d5f8520c2b1..645bbc6af675 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1620,9 +1620,15 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { compile.$$createComment = function(directiveName, comment) { var content = ''; + if (debugInfoEnabled) { - content = ' ' + (directiveName || '') + ': ' + (comment || '') + ' '; + content = ' '; + content += (directiveName || ''); + content += ':'; + content += comment ? ' ' + comment : ''; + content += ' '; } + return window.document.createComment(content); }; From d1dbd93c44aed8b7852eed3d4f7cd5f9f660f20b Mon Sep 17 00:00:00 2001 From: Ivo Mirra Date: Mon, 2 May 2016 20:43:13 +0100 Subject: [PATCH 2/3] fix($compile): Fix unit tests --- test/ng/compileSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index f0437df6691d..d424fb42f580 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -8438,7 +8438,7 @@ describe('$compile', function() { expect(function() { $compile('
'); }).toThrowMinErr('$compile', 'multidir', 'Multiple directives [first, second] asking for transclusion on: ' + - ''); + ''); }); }); From c6cfb1b734f91dfd3dbf9fc5e45cce4e6919d59c Mon Sep 17 00:00:00 2001 From: Ivo Mirra Date: Mon, 2 May 2016 21:23:25 +0100 Subject: [PATCH 3/3] fix($compile): Remove spaces --- src/ng/compile.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index 645bbc6af675..35dd7d1bef31 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1620,7 +1620,6 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { compile.$$createComment = function(directiveName, comment) { var content = ''; - if (debugInfoEnabled) { content = ' '; content += (directiveName || ''); @@ -1628,7 +1627,6 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { content += comment ? ' ' + comment : ''; content += ' '; } - return window.document.createComment(content); };