fix(angular.bootstrap): only allow angular to load once

This is hard to test as a unit-test, since it involves the actual loading
of angular, but it turns out that it is easy to test using a protractor
e2e test.

Closes #5863
Closes #5587
This commit is contained in:
Siddique Hameed
2014-01-17 12:17:22 -06:00
committed by Peter Bacon Darwin
parent ed4cd6c3c6
commit 748a6c8d9d
2 changed files with 41 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
if (window.angular.bootstrap) {
//AngularJS is already loaded, so we can return here...
console.log('WARNING: Tried to load angular more than once.');
return;
}
//try to bind to jquery now so that one can write angular.element().read()
//but we will rebind on bootstrap again.
bindJQuery();