2013-07-13 00:42:27 +00:00
|
|
|
@ngdoc error
|
|
|
|
|
@name $injector:nomod
|
|
|
|
|
@fullName Module Unavailable
|
|
|
|
|
@description
|
2013-08-01 22:11:10 +00:00
|
|
|
|
|
|
|
|
This error occurs when trying to "re-open" a module that has not yet been defined.
|
|
|
|
|
|
|
|
|
|
To define a new module, call {@link api/angular.module angular.module} with a name
|
|
|
|
|
and an array of dependent modules, like so:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
// When defining a module with no module dependencies,
|
|
|
|
|
// the requires array should be defined and empty.
|
|
|
|
|
var myApp = angular.module('myApp', []);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
To retrieve a reference to the same module for further configuration, call
|
|
|
|
|
`angular.module` without the `requires` array.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
var myApp = angular.module('myApp');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Calling `angular.module` without the `requires` array when the module has not yet
|
|
|
|
|
been defined causes this error to be thrown. To fix it, define your module with
|
|
|
|
|
a name and an empty array, as in the first example above.
|