Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 008fbe5

Browse files
committed
docs(errors/$injector/nomod): add info about forgetting to load the module file
Closes #3752
1 parent ae342b5 commit 008fbe5

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

docs/content/error/$injector/nomod.ngdoc

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,31 @@
33
@fullName Module Unavailable
44
@description
55

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.
714

815
To define a new module, call {@link angular.module angular.module} with a name
916
and an array of dependent modules, like so:
1017

11-
```
18+
```js
1219
// 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.
1421
var myApp = angular.module('myApp', []);
1522
```
1623

1724
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.
1926

20-
```
27+
```js
2128
var myApp = angular.module('myApp');
2229
```
2330

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

Comments
 (0)