3
3
@fullName Module Unavailable
4
4
@description
5
5
6
- This error occurs when trying to "re-open" a module that has not yet been defined.
6
+ This error occurs when you declare a dependency on a module that isn't defined anywhere or hasn't
7
+ been loaded in the current browser context.
8
+
9
+ When you receive this error, check that the name of the module in question is correct and that the
10
+ file in which this module is defined has been loaded (either via `<script>` tag, loader like
11
+ require.js, or testing harness like karma).
12
+
13
+ A less common reason for this error is trying to "re-open" a module that has not yet been defined.
7
14
8
15
To define a new module, call {@link angular.module angular.module} with a name
9
16
and an array of dependent modules, like so:
10
17
11
- ```
18
+ ```js
12
19
// When defining a module with no module dependencies,
13
- // the requires array should be defined and empty.
20
+ // the array of dependencies should be defined and empty.
14
21
var myApp = angular.module('myApp', []);
15
22
```
16
23
17
24
To retrieve a reference to the same module for further configuration, call
18
- `angular.module` without the `requires` array.
25
+ `angular.module` without the array argument .
19
26
20
- ```
27
+ ```js
21
28
var myApp = angular.module('myApp');
22
29
```
23
30
24
- Calling `angular.module` without the `requires` array when the module has not yet
25
- been defined causes this error to be thrown. To fix it, define your module with
26
- a name and an empty array, as in the first example above.
31
+ Calling `angular.module` without the array of dependencies when the module has not yet been defined
32
+ causes this error to be thrown. To fix it, define your module with a name and an empty array, as in
33
+ the first example above.
0 commit comments