This error occurs when you declare a dependency on a module that is not defined anywhere or has not been loaded in the current browser context.
If you receive this error, check the name of the module in question and whether the file in which this module is defined is loaded (either via the <script> , a loader, for example, require.js, or a test harness as karma).
A less common cause of this error is an attempt to βreopenβ a module that is not yet defined.
To define a new module, call angular.module with a name and an array of dependent modules, for example:
// When defining a module with no module dependencies, // the array of dependencies should be defined and empty. var myApp = angular.module('myApp', []);
To get a link to the same module for further configuration, call angular.module without an array argument.
var myApp = angular.module('myApp');
A call to angular.module without an array of dependencies, when the module is not yet defined, causes this error. To fix this, define your module with a name and an empty array, as in the first example above.
source share