From e4b6a1eaa4a432b0082c7abbff8f4bb169cf846e Mon Sep 17 00:00:00 2001 From: Ken Sheedlo Date: Thu, 1 Aug 2013 15:11:10 -0700 Subject: docs(minerr): fill in error message descriptions Errors I've documented so far: - `$injector:cdep` - `$injector:itkn` - `$injector:modulerr` - `$injector:nomod` - `$injector:pget` - `$injector:unpr` - `ng:areq` - `ng:cpi` - `ng:cpws` - `ngModel:noass` Closes #3430 --- docs/content/error/injector/nomod.ngdoc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'docs/content/error/injector/nomod.ngdoc') diff --git a/docs/content/error/injector/nomod.ngdoc b/docs/content/error/injector/nomod.ngdoc index 6dd4c169..66e2a5ad 100644 --- a/docs/content/error/injector/nomod.ngdoc +++ b/docs/content/error/injector/nomod.ngdoc @@ -2,3 +2,25 @@ @name $injector:nomod @fullName Module Unavailable @description + +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. \ No newline at end of file -- cgit v1.2.3