mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
docs(error/ng/btstrpd): note that loading angular.js twice can cause the error
Closes #6502
This commit is contained in:
committed by
Peter Bacon Darwin
parent
27b7fa3914
commit
6b18a564dd
@@ -3,9 +3,11 @@
|
||||
@fullName App Already Bootstrapped with this Element
|
||||
@description
|
||||
|
||||
Occurs when calling angular.bootstrap on an element that has already been bootstrapped.
|
||||
Occurs when calling {@link 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.
|
||||
|
||||
This usually happens when you accidentally use both `ng-app` and `angular.bootstrap` to bootstrap an application.
|
||||
|
||||
```
|
||||
<html>
|
||||
@@ -18,7 +20,9 @@ This usually happens when you accidentally use both `ng-app` and `angular.bootst
|
||||
</html>
|
||||
```
|
||||
|
||||
Note that for bootrapping purposes, the `<html>` element is the same as `document`, so the following will also throw an error.
|
||||
Note that for bootrapping purposes, the `<html>` element is the same as `document`, so the following
|
||||
will also throw an error.
|
||||
|
||||
```
|
||||
<html>
|
||||
...
|
||||
@@ -27,3 +31,22 @@ Note that for bootrapping purposes, the `<html>` element is the same as `documen
|
||||
</script>
|
||||
</html>
|
||||
```
|
||||
|
||||
You can also get this error if you accidentally load AngularJS itself more than once.
|
||||
|
||||
```
|
||||
<html ng-app>
|
||||
<head>
|
||||
<script src="angular.js"></script>
|
||||
|
||||
...
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
...
|
||||
|
||||
<script src="angular.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
Reference in New Issue
Block a user