mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
fix(loader): expose $$minErr to modules such asngResource
This is highlighted in angular-phonecat when you try to use the index-async.html which needs to load the ngResource module asynchronously but fails when it tries to call `angular.$$minErr` to create the $resourceMinErr object. Closes #5050
This commit is contained in:
parent
e6521e7491
commit
9e89a31b12
2 changed files with 10 additions and 1 deletions
|
|
@ -17,7 +17,12 @@ function setupModuleLoader(window) {
|
|||
return obj[name] || (obj[name] = factory());
|
||||
}
|
||||
|
||||
return ensure(ensure(window, 'angular', Object), 'module', function() {
|
||||
var angular = ensure(window, 'angular', Object);
|
||||
|
||||
// We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap
|
||||
angular.$$minErr = angular.$$minErr || minErr;
|
||||
|
||||
return ensure(angular, 'module', function() {
|
||||
/** @type {Object.<string, angular.Module>} */
|
||||
var modules = {};
|
||||
|
||||
|
|
|
|||
|
|
@ -78,4 +78,8 @@ describe('module loader', function() {
|
|||
window.angular.module('hasOwnProperty', []);
|
||||
}).toThrowMinErr('ng','badname', "hasOwnProperty is not a valid module name");
|
||||
});
|
||||
|
||||
it('should expose `$$minErr` on the `angular` object', function() {
|
||||
expect(window.angular.$$minErr).toEqual(jasmine.any(Function));
|
||||
})
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue