Code fix
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2020-03-18 14:06:06 +01:00
parent bac3a4a30d
commit ab822c6061
1 changed files with 8 additions and 3 deletions

View File

@ -17,8 +17,8 @@ core.run(vnInterceptor => {
vnInterceptor.setApiPath(null); vnInterceptor.setApiPath(null);
}); });
window.ngModule = function(moduleName, fn) { window.ngModule = function(moduleName, ...args) {
return angular.mock.module(moduleName, function($provide, $translateProvider) { let fns = [moduleName, function($provide, $translateProvider) {
// Avoid unexpected request warnings caused by angular translate // Avoid unexpected request warnings caused by angular translate
// https://angular-translate.github.io/docs/#/guide/22_unit-testing-with-angular-translate // https://angular-translate.github.io/docs/#/guide/22_unit-testing-with-angular-translate
$provide.factory('customLocaleLoader', function($q) { $provide.factory('customLocaleLoader', function($q) {
@ -30,5 +30,10 @@ window.ngModule = function(moduleName, fn) {
}); });
$translateProvider.useLoader('customLocaleLoader'); $translateProvider.useLoader('customLocaleLoader');
}, fn); }];
if (args.length)
fns = fns.concat(args);
return angular.mock.module(...fns);
}; };