fix($injector): improve $injector:nomod error message

Closes #2695
This commit is contained in:
Igor Minar 2013-07-11 12:15:58 -07:00
parent 31631b2b28
commit e82d780c2e
2 changed files with 6 additions and 2 deletions

View file

@ -70,7 +70,9 @@ function setupModuleLoader(window) {
}
return ensure(modules, name, function() {
if (!requires) {
throw minErr('$injector')('nomod', "Module '{0}' is not available! You either misspelled the module name or forgot to load it.", name);
throw minErr('$injector')('nomod', "Module '{0}' is not available! You either misspelled the module name " +
"or forgot to load it. If registering a module ensure that you specify the dependencies as the second " +
"argument.", name);
}
/** @type {!Array.<Array.<*>>} */

View file

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