diff --git a/src/Angular.js b/src/Angular.js index 9d047ae04643..461c5266ba19 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -1345,7 +1345,11 @@ function bootstrap(element, modules) { if (element.injector()) { var tag = (element[0] === document) ? 'document' : startingTag(element); - throw ngMinErr('btstrpd', "App Already Bootstrapped with this Element '{0}'", tag); + //Encode angle brackets to prevent input from being sanitized to empty string #8683 + throw ngMinErr( + 'btstrpd', + "App Already Bootstrapped with this Element '{0}'", + tag.replace(//,'>')); } modules = modules || []; diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 148f80f29a80..33ce03b18c6c 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -822,7 +822,7 @@ describe('angular', function() { expect(function () { angular.bootstrap(element); }).toThrowMatching( - /\[ng:btstrpd\] App Already Bootstrapped with this Element '
'/i + /\[ng:btstrpd\] App Already Bootstrapped with this Element '<div class="?ng\-scope"?( ng[0-9]+="?[0-9]+"?)?>'/i ); dealoc(element);