diff --git a/src/Angular.js b/src/Angular.js index 678c6fe12484..f29a5c5ec504 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -1395,7 +1395,11 @@ function bootstrap(element, modules, config) { 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 878eb9567d63..0b9ae8411658 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -786,7 +786,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);