diff --git a/src/angular.bind.js b/src/angular.bind.js index 33bc710d4342..45bcdecb7247 100644 --- a/src/angular.bind.js +++ b/src/angular.bind.js @@ -1,6 +1,8 @@ if (window.angular.bootstrap) { //AngularJS is already loaded, so we can return here... - console.log('WARNING: Tried to load angular more than once.'); + if (window.console) { + console.log('WARNING: Tried to load angular more than once.'); + } return; } diff --git a/test/e2e/fixtures/angular-already-loaded/index.html b/test/e2e/fixtures/angular-already-loaded/index.html new file mode 100644 index 000000000000..292124d4fe1b --- /dev/null +++ b/test/e2e/fixtures/angular-already-loaded/index.html @@ -0,0 +1,10 @@ + + +
+

{{text}}

+
+ + + + + diff --git a/test/e2e/fixtures/angular-already-loaded/script.js b/test/e2e/fixtures/angular-already-loaded/script.js new file mode 100644 index 000000000000..2d625bb4f19c --- /dev/null +++ b/test/e2e/fixtures/angular-already-loaded/script.js @@ -0,0 +1,4 @@ +angular.module("test", []). + controller("TestCtrl", function($scope) { + $scope.text = "Hello, world!"; + }); diff --git a/test/e2e/tests/angular-already-loadedSpec.js b/test/e2e/tests/angular-already-loadedSpec.js new file mode 100644 index 000000000000..87e4d8aabe14 --- /dev/null +++ b/test/e2e/tests/angular-already-loadedSpec.js @@ -0,0 +1,10 @@ +describe('App where angular is loaded more than once', function() { + beforeEach(function() { + loadFixture("angular-already-loaded").andWaitForAngular(); + }); + + it('should have the interpolated text', function() { + expect(element(by.binding('text')).getText()) + .toBe('Hello, world!'); + }); +});