Skip to content

Commit 72e508d

Browse files
IgorMinarctrahey
authored andcommitted
fix($injector): improve $injector:nomod error message
Closes angular#2695
1 parent 43c96f6 commit 72e508d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/loader.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ function setupModuleLoader(window) {
7070
}
7171
return ensure(modules, name, function() {
7272
if (!requires) {
73-
throw minErr('$injector')('nomod', "Module '{0}' is not available! You either misspelled the module name or forgot to load it.", name);
73+
throw minErr('$injector')('nomod', "Module '{0}' is not available! You either misspelled the module name " +
74+
"or forgot to load it. If registering a module ensure that you specify the dependencies as the second " +
75+
"argument.", name);
7476
}
7577

7678
/** @type {!Array.<Array.<*>>} */

test/loaderSpec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ describe('module loader', function() {
6868
it('should complain of no module', function() {
6969
expect(function() {
7070
window.angular.module('dontExist');
71-
}).toThrow("[$injector:nomod] Module 'dontExist' is not available! You either misspelled the module name or forgot to load it.");
71+
}).toThrow("[$injector:nomod] Module 'dontExist' is not available! You either misspelled the module name " +
72+
"or forgot to load it. If registering a module ensure that you specify the dependencies as the second " +
73+
"argument.");
7274
});
7375
});

0 commit comments

Comments
 (0)