Commit e448e8cd authored by bingchuan's avatar bingchuan

[dev]2.18.4

parent 5c88f0d3
/*!
* angular-translate - v2.13.1 - 2016-12-06 1
* angular-translate - v2.18.4 - 2021-01-14
*
* Copyright (c) 2016 The angular-translate team, Pascal Precht; Licensed MIT
* Copyright (c) 2021 The angular-translate team, Pascal Precht; Licensed MIT
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
......@@ -9,7 +9,7 @@
define([], function () {
return (factory());
});
} else if (typeof exports === 'object') {
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
......@@ -19,9 +19,9 @@
}
}(this, function () {
$translateStaticFilesLoader.$inject = ['$q', '$http'];
angular.module('pascalprecht.translate')
/**
$translateStaticFilesLoader.$inject = ['$q', '$http'];
angular.module('pascalprecht.translate')
/**
* @ngdoc object
* @name pascalprecht.translate.$translateStaticFilesLoader
* @requires $q
......@@ -34,9 +34,9 @@ angular.module('pascalprecht.translate')
*
* @param {object} options Options object, which gets prefix, suffix, key, and fileMap
*/
.factory('$translateStaticFilesLoader', $translateStaticFilesLoader);
.factory('$translateStaticFilesLoader', $translateStaticFilesLoader);
function $translateStaticFilesLoader($q, $http) {
function $translateStaticFilesLoader($q, $http) {
'use strict';
......@@ -45,6 +45,7 @@ function $translateStaticFilesLoader($q, $http) {
if (!options || (!angular.isArray(options.files) && (!angular.isString(options.prefix) || !angular.isString(options.suffix)))) {
throw new Error('Couldn\'t load static files, no files and prefix or suffix specified!');
}
if (!options.files) {
options.files = [{
prefix: options.prefix,
......@@ -69,8 +70,7 @@ function $translateStaticFilesLoader($q, $http) {
return $http(angular.extend({
url: fileUrl,
method: 'GET',
params: ''
method: 'GET'
}, options.$http))
.then(function(result) {
return result.data;
......@@ -104,9 +104,9 @@ function $translateStaticFilesLoader($q, $http) {
return mergedData;
});
};
}
}
$translateStaticFilesLoader.displayName = '$translateStaticFilesLoader';
return 'pascalprecht.translate';
$translateStaticFilesLoader.displayName = '$translateStaticFilesLoader';
return 'pascalprecht.translate';
}));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment