aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/error/ng/btstrpd.ngdoc
blob: 4efbaba533cb893ca0e53e56465f923440aa4597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@ngdoc error
@name ng:btstrpd
@fullName App Already Bootstrapped with this Element
@description

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.


```
<html>
...
  <body ng-app="myApp">
    <script>
      angular.bootstrap(document.body, ['myApp']);
    </script>
  </body>
</html>
```

Note that for bootrapping purposes, the `<html>` element is the same as `document`, so the following
will also throw an error.

```
<html>
...
<script>
  angular.bootstrap(document, ['myApp']);
</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>
```