diff options
author | Travis Tripp <travis.tripp@hp.com> | 2014-12-17 10:49:18 -0700 |
---|---|---|
committer | Travis Tripp <travis.tripp@hp.com> | 2014-12-18 11:04:11 -0700 |
commit | dac047df05da5bb20de4e78876bc03820d0c6671 (patch) | |
tree | 755e12a695b93e8e23dd035bee7e351256529457 /xstatic/pkg/angular/data/angular-loader.js | |
parent | 7300bd88ba20368ef86c93428f78acac6f5d9c71 (diff) | |
download | xstatic-angular-dac047df05da5bb20de4e78876bc03820d0c6671.tar.gz |
Angular xstatic for Version 1.3.71.3.7.0
Adding version 1.3.7
1.3.x angular is needed for launch instance work.
Partially Implements: blueprint launch-instance-redesign
Change-Id: Ib45130a624cace9139a5309470f70ed2983b8cb3
Diffstat (limited to 'xstatic/pkg/angular/data/angular-loader.js')
-rw-r--r-- | xstatic/pkg/angular/data/angular-loader.js | 71 |
1 files changed, 32 insertions, 39 deletions
diff --git a/xstatic/pkg/angular/data/angular-loader.js b/xstatic/pkg/angular/data/angular-loader.js index 7bf81bb..2ef986c 100644 --- a/xstatic/pkg/angular/data/angular-loader.js +++ b/xstatic/pkg/angular/data/angular-loader.js @@ -1,5 +1,5 @@ /** - * @license AngularJS v1.2.16 + * @license AngularJS v1.3.7 * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ @@ -31,52 +31,37 @@ * should all be static strings, not variables or general expressions. * * @param {string} module The namespace to use for the new minErr instance. + * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning + * error from returned function, for cases when a particular type of error is useful. * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance */ -function minErr(module) { - return function () { +function minErr(module, ErrorConstructor) { + ErrorConstructor = ErrorConstructor || Error; + return function() { var code = arguments[0], prefix = '[' + (module ? module + ':' : '') + code + '] ', template = arguments[1], templateArgs = arguments, - stringify = function (obj) { - if (typeof obj === 'function') { - return obj.toString().replace(/ \{[\s\S]*$/, ''); - } else if (typeof obj === 'undefined') { - return 'undefined'; - } else if (typeof obj !== 'string') { - return JSON.stringify(obj); - } - return obj; - }, + message, i; - message = prefix + template.replace(/\{\d+\}/g, function (match) { + message = prefix + template.replace(/\{\d+\}/g, function(match) { var index = +match.slice(1, -1), arg; if (index + 2 < templateArgs.length) { - arg = templateArgs[index + 2]; - if (typeof arg === 'function') { - return arg.toString().replace(/ ?\{[\s\S]*$/, ''); - } else if (typeof arg === 'undefined') { - return 'undefined'; - } else if (typeof arg !== 'string') { - return toJson(arg); - } - return arg; + return toDebugString(templateArgs[index + 2]); } return match; }); - message = message + '\nhttp://errors.angularjs.org/1.2.16/' + + message = message + '\nhttp://errors.angularjs.org/1.3.7/' + (module ? module + '/' : '') + code; for (i = 2; i < arguments.length; i++) { - message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' + - encodeURIComponent(stringify(arguments[i])); + message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' + + encodeURIComponent(toDebugString(arguments[i])); } - - return new Error(message); + return new ErrorConstructor(message); }; } @@ -124,7 +109,7 @@ function setupModuleLoader(window) { * * # Module * - * A module is a collection of services, directives, filters, and configuration information. + * A module is a collection of services, directives, controllers, filters, and configuration information. * `angular.module` is used to configure the {@link auto.$injector $injector}. * * ```js @@ -152,9 +137,9 @@ function setupModuleLoader(window) { * {@link angular.bootstrap} to simplify this process for you. * * @param {!string} name The name of the module to create or retrieve. -<<<<<* @param {!Array.<string>=} requires If specified then new module is being created. If ->>>>>* unspecified then the module is being retrieved for further configuration. - * @param {Function} configFn Optional configuration function for the module. Same as + * @param {!Array.<string>=} requires If specified then new module is being created. If + * unspecified then the module is being retrieved for further configuration. + * @param {Function=} configFn Optional configuration function for the module. Same as * {@link angular.Module#config Module#config()}. * @returns {module} new module with the {@link angular.Module} api. */ @@ -180,21 +165,25 @@ function setupModuleLoader(window) { var invokeQueue = []; /** @type {!Array.<Function>} */ + var configBlocks = []; + + /** @type {!Array.<Function>} */ var runBlocks = []; - var config = invokeLater('$injector', 'invoke'); + var config = invokeLater('$injector', 'invoke', 'push', configBlocks); /** @type {angular.Module} */ var moduleInstance = { // Private state _invokeQueue: invokeQueue, + _configBlocks: configBlocks, _runBlocks: runBlocks, /** * @ngdoc property * @name angular.Module#requires * @module ng - * @returns {Array.<string>} List of module names which must be loaded before this module. + * * @description * Holds the list of modules which the injector will load before the current module is * loaded. @@ -205,8 +194,9 @@ function setupModuleLoader(window) { * @ngdoc property * @name angular.Module#name * @module ng - * @returns {string} Name of the module. + * * @description + * Name of the module. */ name: name, @@ -297,7 +287,7 @@ function setupModuleLoader(window) { * }) * ``` * - * See {@link ngAnimate.$animateProvider#register $animateProvider.register()} and + * See {@link ng.$animateProvider#register $animateProvider.register()} and * {@link ngAnimate ngAnimate module} for more information. */ animation: invokeLater('$animateProvider', 'register'), @@ -346,6 +336,8 @@ function setupModuleLoader(window) { * configuration. * @description * Use this method to register work which needs to be performed on module loading. + * For more about how to configure services, see + * {@link providers#provider-recipe Provider Recipe}. */ config: config, @@ -369,7 +361,7 @@ function setupModuleLoader(window) { config(configFn); } - return moduleInstance; + return moduleInstance; /** * @param {string} provider @@ -377,9 +369,10 @@ function setupModuleLoader(window) { * @param {String=} insertMethod * @returns {angular.Module} */ - function invokeLater(provider, method, insertMethod) { + function invokeLater(provider, method, insertMethod, queue) { + if (!queue) queue = invokeQueue; return function() { - invokeQueue[insertMethod || 'push']([provider, method, arguments]); + queue[insertMethod || 'push']([provider, method, arguments]); return moduleInstance; }; } |