Please sign in to comment.
fix(re-bootstrap): Throw an error when bootstrapping a bootstrapped e…
…lement. Nothing would prevent a user from accidentally calling angular.bootstrap on an element that had already been bootstrapped. If this was done, odd behavior could manifest in an application, causing different scopes to update the same DOM, and causing debugger confusion. This fix adds a check inside of angular.bootstrap to check if the passed-in element already has an injector, and if so, will throw an error.
- Loading branch information...
Showing with 61 additions and 0 deletions.
|@@ -0,0 +1,29 @@|
|+@fullName App Already Bootstrapped with this Element|
|+Occurs when calling angular.bootstrap on an element that has already been bootstrapped.|
|+This usually happens when you accidentally use both `ng-app` and `angular.bootstrap` to bootstrap an application.|
|+ <body ng-app="myApp">|
|+ angular.bootstrap(document.body, ['myApp']);|
|+Note that for bootrapping purposes, the `<html>` element is the same as `document`, so the following will also throw an error.|
|+ angular.bootstrap(document, ['myApp']);|