diff options
304 files changed, 1951 insertions, 1187 deletions
| diff --git a/i18n/src/closureI18nExtractor.js b/i18n/src/closureI18nExtractor.js index 05e3997d..83146d07 100644 --- a/i18n/src/closureI18nExtractor.js +++ b/i18n/src/closureI18nExtractor.js @@ -159,6 +159,7 @@ function outputLocale(localeInfo, localeID) {    localeObj.id = correctedLocaleId(localeID);    var prefix = +      "'use strict';\n" +        'angular.module("ngLocale", [], ["$provide", function($provide) {\n' +            'var PLURAL_CATEGORY = {' +            'ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"' + diff --git a/src/Angular.js b/src/Angular.js index 085e062d..7a6dc5ec 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -1,5 +1,88 @@  'use strict'; +/* We need to tell jshint what variables are being exported */ +/* global +    -angular, +    -msie, +    -jqLite, +    -jQuery, +    -slice, +    -push, +    -toString, +    -ngMinErr, +    -_angular, +    -angularModule, +    -nodeName_, +    -uid, + +    -lowercase, +    -uppercase, +    -manualLowercase, +    -manualUppercase, +    -nodeName_, +    -isArrayLike, +    -forEach, +    -sortedKeys, +    -forEachSorted, +    -reverseParams, +    -nextUid, +    -setHashKey, +    -extend, +    -int, +    -inherit, +    -noop, +    -identity, +    -valueFn, +    -isUndefined, +    -isDefined, +    -isObject, +    -isString, +    -isNumber, +    -isDate, +    -isArray, +    -isFunction, +    -isRegExp, +    -isWindow, +    -isScope, +    -isFile, +    -isBoolean, +    -trim, +    -isElement, +    -makeMap, +    -map, +    -size, +    -includes, +    -indexOf, +    -arrayRemove, +    -isLeafNode, +    -copy, +    -shallowCopy, +    -equals, +    -csp, +    -concat, +    -sliceArgs, +    -bind, +    -toJsonReplacer, +    -toJson, +    -fromJson, +    -toBoolean, +    -startingTag, +    -tryDecodeURIComponent, +    -parseKeyValue, +    -toKeyValue, +    -encodeUriSegment, +    -encodeUriQuery, +    -angularInit, +    -bootstrap, +    -snake_case, +    -bindJQuery, +    -assertArg, +    -assertArgFn, +    -assertNotHasOwnProperty, +    -getter + +*/ +  ////////////////////////////////////  /** @@ -27,11 +110,13 @@ var uppercase = function(string){return isString(string) ? string.toUpperCase()  var manualLowercase = function(s) { +  /* jshint bitwise: false */    return isString(s)        ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})        : s;  };  var manualUppercase = function(s) { +  /* jshint bitwise: false */    return isString(s)        ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})        : s; @@ -77,7 +162,8 @@ if (isNaN(msie)) {  /**   * @private   * @param {*} obj - * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, String ...) + * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, + *                   String ...)   */  function isArrayLike(obj) {    if (obj == null || isWindow(obj)) { @@ -171,7 +257,7 @@ function forEachSorted(obj, iterator, context) {   * @returns {function(*, string)}   */  function reverseParams(iteratorFn) { -  return function(value, key) { iteratorFn(key, value) }; +  return function(value, key) { iteratorFn(key, value); };  }  /** @@ -530,17 +616,17 @@ function map(obj, iterator, context) {   * @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array.   */  function size(obj, ownPropsOnly) { -  var size = 0, key; +  var count = 0, key;    if (isArray(obj) || isString(obj)) {      return obj.length;    } else if (isObject(obj)){      for (key in obj)        if (!ownPropsOnly || obj.hasOwnProperty(key)) -        size++; +        count++;    } -  return size; +  return count;  } @@ -637,7 +723,8 @@ function isLeafNode (node) {   */  function copy(source, destination){    if (isWindow(source) || isScope(source)) { -    throw ngMinErr('cpws', "Can't copy! Making copies of Window or Scope instances is not supported."); +    throw ngMinErr('cpws', +      "Can't copy! Making copies of Window or Scope instances is not supported.");    }    if (!destination) { @@ -654,7 +741,8 @@ function copy(source, destination){        }      }    } else { -    if (source === destination) throw ngMinErr('cpi', "Can't copy! Source and destination are identical."); +    if (source === destination) throw ngMinErr('cpi', +      "Can't copy! Source and destination are identical.");      if (isArray(source)) {        destination.length = 0;        for ( var i = 0; i < source.length; i++) { @@ -698,8 +786,8 @@ function shallowCopy(src, dst) {   * @function   *   * @description - * Determines if two objects or two values are equivalent. Supports value types, regular expressions, arrays and - * objects. + * Determines if two objects or two values are equivalent. Supports value types, regular + * expressions, arrays and objects.   *   * Two objects or values are considered equivalent if at least one of the following is true:   * @@ -776,6 +864,7 @@ function sliceArgs(args, startIndex) {  } +/* jshint -W101 */  /**   * @ngdoc function   * @name angular.bind @@ -784,14 +873,15 @@ function sliceArgs(args, startIndex) {   * @description   * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for   * `fn`). You can supply optional `args` that are prebound to the function. This feature is also - * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as distinguished - * from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application). + * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as + * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).   *   * @param {Object} self Context which `fn` should be evaluated in.   * @param {function()} fn Function to be bound.   * @param {...*} args Optional arguments to be prebound to the `fn` function call.   * @returns {function()} Function that wraps the `fn` with all the specified bindings.   */ +/* jshint +W101 */  function bind(self, fn) {    var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];    if (isFunction(fn) && !(fn instanceof RegExp)) { @@ -951,10 +1041,12 @@ function toKeyValue(obj) {    forEach(obj, function(value, key) {      if (isArray(value)) {        forEach(value, function(arrayValue) { -        parts.push(encodeUriQuery(key, true) + (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true))); +        parts.push(encodeUriQuery(key, true) + +                   (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));        });      } else { -    parts.push(encodeUriQuery(key, true) + (value === true ? '' : '=' + encodeUriQuery(value, true))); +    parts.push(encodeUriQuery(key, true) + +               (value === true ? '' : '=' + encodeUriQuery(value, true)));      }    });    return parts.length ? parts.join('&') : ''; @@ -1016,8 +1108,8 @@ function encodeUriQuery(val, pctEncodeSpaces) {   * designates the root of the application and is typically placed   * at the root of the page.   * - * The first ngApp found in the document will be auto-bootstrapped. To use multiple applications in an - * HTML document you must manually bootstrap them using {@link angular.bootstrap}. + * The first ngApp found in the document will be auto-bootstrapped. To use multiple applications in + * an HTML document you must manually bootstrap them using {@link angular.bootstrap}.   * Applications cannot be nested.   *   * In the example below if the `ngApp` directive were not placed @@ -1091,7 +1183,8 @@ function angularInit(element, bootstrap) {   * @param {Element} element DOM element which is the root of angular application.   * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.   *     Each item in the array should be the name of a predefined module or a (DI annotated) - *     function that will be invoked by the injector as a run block. See: {@link angular.module modules} + *     function that will be invoked by the injector as a run block. + *     See: {@link angular.module modules}   * @returns {AUTO.$injector} Returns the newly created injector for this app.   */  function bootstrap(element, modules) { @@ -1156,10 +1249,11 @@ function bindJQuery() {        injector: JQLitePrototype.injector,        inheritedData: JQLitePrototype.inheritedData      }); -    // Method signature: JQLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) -    JQLitePatchJQueryRemove('remove', true, true, false); -    JQLitePatchJQueryRemove('empty', false, false, false); -    JQLitePatchJQueryRemove('html', false, false, true); +    // Method signature: +    //     jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) +    jqLitePatchJQueryRemove('remove', true, true, false); +    jqLitePatchJQueryRemove('empty', false, false, false); +    jqLitePatchJQueryRemove('html', false, false, true);    } else {      jqLite = JQLite;    } diff --git a/src/AngularPublic.js b/src/AngularPublic.js index 09361079..eb97b4c5 100755..100644 --- a/src/AngularPublic.js +++ b/src/AngularPublic.js @@ -1,5 +1,79 @@  'use strict'; +/* global +    angularModule: true, +    version: true, +     +    $LocaleProvider, +    $CompileProvider, +     +    htmlAnchorDirective, +    inputDirective, +    inputDirective, +    formDirective, +    scriptDirective, +    selectDirective, +    styleDirective, +    optionDirective, +    ngBindDirective, +    ngBindHtmlDirective, +    ngBindTemplateDirective, +    ngClassDirective, +    ngClassEvenDirective, +    ngClassOddDirective, +    ngCspDirective, +    ngCloakDirective, +    ngControllerDirective, +    ngFormDirective, +    ngHideDirective, +    ngIfDirective, +    ngIncludeDirective, +    ngInitDirective, +    ngNonBindableDirective, +    ngPluralizeDirective, +    ngRepeatDirective, +    ngShowDirective, +    ngStyleDirective, +    ngSwitchDirective, +    ngSwitchWhenDirective, +    ngSwitchDefaultDirective, +    ngOptionsDirective, +    ngTranscludeDirective, +    ngModelDirective, +    ngListDirective, +    ngChangeDirective, +    requiredDirective, +    requiredDirective, +    ngValueDirective, +    ngAttributeAliasDirectives, +    ngEventDirectives, + +    $AnchorScrollProvider, +    $AnimateProvider, +    $BrowserProvider, +    $CacheFactoryProvider, +    $ControllerProvider, +    $DocumentProvider, +    $ExceptionHandlerProvider, +    $FilterProvider, +    $InterpolateProvider, +    $IntervalProvider, +    $HttpProvider, +    $HttpBackendProvider, +    $LocationProvider, +    $LogProvider, +    $ParseProvider, +    $RootScopeProvider, +    $QProvider, +    $SceProvider, +    $SceDelegateProvider, +    $SnifferProvider, +    $TemplateCacheProvider, +    $TimeoutProvider, +    $WindowProvider +*/ + +  /**   * @ngdoc property   * @name angular.version diff --git a/src/auto/injector.js b/src/auto/injector.js index 075f3ee8..26dbef81 100644 --- a/src/auto/injector.js +++ b/src/auto/injector.js @@ -116,9 +116,9 @@ function annotate(fn) {   *   * ## Inference   * - * In JavaScript calling `toString()` on a function returns the function definition. The definition can then be - * parsed and the function arguments can be extracted. *NOTE:* This does not work with minification, and obfuscation - * tools since these tools change the argument names. + * In JavaScript calling `toString()` on a function returns the function definition. The definition + * can then be parsed and the function arguments can be extracted. *NOTE:* This does not work with + * minification, and obfuscation tools since these tools change the argument names.   *   * ## `$inject` Annotation   * By adding a `$inject` property onto a function the injection parameters can be specified. @@ -150,8 +150,8 @@ function annotate(fn) {   * @param {!function} fn The function to invoke. Function parameters are injected according to the   *   {@link guide/di $inject Annotation} rules.   * @param {Object=} self The `this` for the invoked method. - * @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before - *   the `$injector` is consulted. + * @param {Object=} locals Optional object. If preset then any argument names are read from this + *                         object first, before the `$injector` is consulted.   * @returns {*} the value returned by the invoked `fn` function.   */ @@ -172,12 +172,13 @@ function annotate(fn) {   * @name AUTO.$injector#instantiate   * @methodOf AUTO.$injector   * @description - * Create a new instance of JS type. The method takes a constructor function invokes the new operator and supplies - * all of the arguments to the constructor function as specified by the constructor annotation. + * Create a new instance of JS type. The method takes a constructor function invokes the new + * operator and supplies all of the arguments to the constructor function as specified by the + * constructor annotation.   *   * @param {function} Type Annotated constructor function. - * @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before - *   the `$injector` is consulted. + * @param {Object=} locals Optional object. If preset then any argument names are read from this + * object first, before the `$injector` is consulted.   * @returns {Object} new instance of `Type`.   */ @@ -187,14 +188,16 @@ function annotate(fn) {   * @methodOf AUTO.$injector   *   * @description - * Returns an array of service names which the function is requesting for injection. This API is used by the injector - * to determine which services need to be injected into the function when the function is invoked. There are three - * ways in which the function can be annotated with the needed dependencies. + * Returns an array of service names which the function is requesting for injection. This API is + * used by the injector to determine which services need to be injected into the function when the + * function is invoked. There are three ways in which the function can be annotated with the needed + * dependencies.   *   * # Argument names   * - * The simplest form is to extract the dependencies from the arguments of the function. This is done by converting - * the function into a string using `toString()` method and extracting the argument names. + * The simplest form is to extract the dependencies from the arguments of the function. This is done + * by converting the function into a string using `toString()` method and extracting the argument + * names.   * <pre>   *   // Given   *   function MyController($scope, $route) { @@ -205,13 +208,13 @@ function annotate(fn) {   *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);   * </pre>   * - * This method does not work with code minification / obfuscation. For this reason the following annotation strategies - * are supported. + * This method does not work with code minification / obfuscation. For this reason the following + * annotation strategies are supported.   *   * # The `$inject` property   * - * If a function has an `$inject` property and its value is an array of strings, then the strings represent names of - * services to be injected into the function. + * If a function has an `$inject` property and its value is an array of strings, then the strings + * represent names of services to be injected into the function.   * <pre>   *   // Given   *   var MyController = function(obfuscatedScope, obfuscatedRoute) { @@ -226,9 +229,9 @@ function annotate(fn) {   *   * # The array notation   * - * It is often desirable to inline Injected functions and that's when setting the `$inject` property is very - * inconvenient. In these situations using the array notation to specify the dependencies in a way that survives - * minification is a better choice: + * It is often desirable to inline Injected functions and that's when setting the `$inject` property + * is very inconvenient. In these situations using the array notation to specify the dependencies in + * a way that survives minification is a better choice:   *   * <pre>   *   // We wish to write this (not minification / obfuscation safe) @@ -254,8 +257,8 @@ function annotate(fn) {   *    ).toEqual(['$compile', '$rootScope']);   * </pre>   * - * @param {function|Array.<string|Function>} fn Function for which dependent service names need to be retrieved as described - *   above. + * @param {function|Array.<string|Function>} fn Function for which dependent service names need to + * be retrieved as described above.   *   * @returns {Array.<string>} The names of the services which the function requires.   */ @@ -269,13 +272,14 @@ function annotate(fn) {   *   * @description   * - * The {@link AUTO.$provide $provide} service has a number of methods for registering components with - * the {@link AUTO.$injector $injector}. Many of these functions are also exposed on {@link angular.Module}. + * The {@link AUTO.$provide $provide} service has a number of methods for registering components + * with the {@link AUTO.$injector $injector}. Many of these functions are also exposed on + * {@link angular.Module}.   *   * An Angular **service** is a singleton object created by a **service factory**.  These **service   * factories** are functions which, in turn, are created by a **service provider**. - * The **service providers** are constructor functions. When instantiated they must contain a property - * called `$get`, which holds the **service factory** function. + * The **service providers** are constructor functions. When instantiated they must contain a + * property called `$get`, which holds the **service factory** function.   *   * When you request a service, the {@link AUTO.$injector $injector} is responsible for finding the   * correct **service provider**, instantiating it and then calling its `$get` **service factory** @@ -292,12 +296,12 @@ function annotate(fn) {   *     providers and services.   * * {@link AUTO.$provide#methods_value value(obj)} - registers a value/object that can only be accessed by   *     services, not providers. - * * {@link AUTO.$provide#methods_factory factory(fn)} - registers a service **factory function**, `fn`, that - *     will be wrapped in a **service provider** object, whose `$get` property will contain the given - *     factory function. + * * {@link AUTO.$provide#factory factory(fn)} - registers a service **factory function**, `fn`, + *     that will be wrapped in a **service provider** object, whose `$get` property will contain the + *     given factory function.   * * {@link AUTO.$provide#methods_service service(class)} - registers a **constructor function**, `class` that - *     will be wrapped in a **service provider** object, whose `$get` property will instantiate a new - *     object using the given constructor function. + *     that will be wrapped in a **service provider** object, whose `$get` property will instantiate + *      a new object using the given constructor function.   *   * See the individual methods for more information and examples.   */ @@ -308,26 +312,31 @@ function annotate(fn) {   * @methodOf AUTO.$provide   * @description   * - * Register a **provider function** with the {@link AUTO.$injector $injector}. Provider functions are - * constructor functions, whose instances are responsible for "providing" a factory for a service. + * Register a **provider function** with the {@link AUTO.$injector $injector}. Provider functions + * are constructor functions, whose instances are responsible for "providing" a factory for a + * service.   *   * Service provider names start with the name of the service they provide followed by `Provider`. - * For example, the {@link ng.$log $log} service has a provider called {@link ng.$logProvider $logProvider}. + * For example, the {@link ng.$log $log} service has a provider called + * {@link ng.$logProvider $logProvider}.   * - * Service provider objects can have additional methods which allow configuration of the provider and - * its service. Importantly, you can configure what kind of service is created by the `$get` method, - * or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a method - * {@link ng.$logProvider#debugEnabled debugEnabled} + * Service provider objects can have additional methods which allow configuration of the provider + * and its service. Importantly, you can configure what kind of service is created by the `$get` + * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a + * method {@link ng.$logProvider#debugEnabled debugEnabled}   * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the   * console or not.   * - * @param {string} name The name of the instance. NOTE: the provider will be available under `name + 'Provider'` key. + * @param {string} name The name of the instance. NOTE: the provider will be available under `name + +                        'Provider'` key.   * @param {(Object|function())} provider If the provider is:   *   *   - `Object`: then it should have a `$get` method. The `$get` method will be invoked using - *               {@link AUTO.$injector#invoke $injector.invoke()} when an instance needs to be created. + *               {@link AUTO.$injector#invoke $injector.invoke()} when an instance needs to be + *               created.   *   - `Constructor`: a new instance of the provider will be created using - *               {@link AUTO.$injector#instantiate $injector.instantiate()}, then treated as `object`. + *               {@link AUTO.$injector#instantiate $injector.instantiate()}, then treated as + *               `object`.   *   * @returns {Object} registered provider instance @@ -405,12 +414,12 @@ function annotate(fn) {   * Register a **service factory**, which will be called to return the service instance.   * This is short for registering a service where its provider consists of only a `$get` property,   * which is the given service factory function. - * You should use {@link AUTO.$provide#factory $provide.factor(getFn)} if you do not need to configure - * your service in a provider. + * You should use {@link AUTO.$provide#factory $provide.factor(getFn)} if you do not need to + * configure your service in a provider.   *   * @param {string} name The name of the instance. - * @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand for - * `$provide.provider(name, {$get: $getFn})`. + * @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand + *                            for `$provide.provider(name, {$get: $getFn})`.   * @returns {Object} registered provider instance   *   * @example @@ -437,7 +446,8 @@ function annotate(fn) {   * @methodOf AUTO.$provide   * @description   * - * Register a **service constructor**, which will be invoked with `new` to create the service instance. + * Register a **service constructor**, which will be invoked with `new` to create the service + * instance.   * This is short for registering a service where its provider's `$get` property is the service   * constructor function that will be used to instantiate the service instance.   * @@ -449,8 +459,8 @@ function annotate(fn) {   * @returns {Object} registered provider instance   *   * @example - * Here is an example of registering a service using {@link AUTO.$provide#methods_service $provide.service(class)} - * that is defined as a CoffeeScript class. + * Here is an example of registering a service using + * {@link AUTO.$provide#methods_service $provide.service(class)} that is defined as a CoffeeScript class.   * <pre>   *   class Ping   *     constructor: (@$http)-> @@ -474,12 +484,14 @@ function annotate(fn) {   * @methodOf AUTO.$provide   * @description   * - * Register a **value service** with the {@link AUTO.$injector $injector}, such as a string, a number, - * an array, an object or a function.  This is short for registering a service where its provider's - * `$get` property is a factory function that takes no arguments and returns the **value service**. + * Register a **value service** with the {@link AUTO.$injector $injector}, such as a string, a + * number, an array, an object or a function.  This is short for registering a service where its + * provider's `$get` property is a factory function that takes no arguments and returns the **value + * service**.   * - * Value services are similar to constant services, except that they cannot be injected into a module - * configuration function (see {@link angular.Module#config}) but they can be overridden by an Angular + * Value services are similar to constant services, except that they cannot be injected into a + * module configuration function (see {@link angular.Module#config}) but they can be overridden by + * an Angular   * {@link AUTO.$provide#decorator decorator}.   *   * @param {string} name The name of the instance. @@ -506,10 +518,10 @@ function annotate(fn) {   * @methodOf AUTO.$provide   * @description   * - * Register a **constant service**, such as a string, a number, an array, an object or a function, with - * the {@link AUTO.$injector $injector}. Unlike {@link AUTO.$provide#value value} it can be injected - * into a module configuration function (see {@link angular.Module#config}) and it cannot be - * overridden by an Angular {@link AUTO.$provide#decorator decorator}. + * Register a **constant service**, such as a string, a number, an array, an object or a function, + * with the {@link AUTO.$injector $injector}. Unlike {@link AUTO.$provide#value value} it can be + * injected into a module configuration function (see {@link angular.Module#config}) and it cannot + * be overridden by an Angular {@link AUTO.$provide#decorator decorator}.   *   * @param {string} name The name of the constant.   * @param {*} value The constant value. @@ -537,8 +549,8 @@ function annotate(fn) {   *   * Register a **service decorator** with the {@link AUTO.$injector $injector}. A service decorator   * intercepts the creation of a service, allowing it to override or modify the behaviour of the - * service. The object returned by the decorator may be the original service, or a new service object - * which replaces or wraps and delegates to the original service. + * service. The object returned by the decorator may be the original service, or a new service + * object which replaces or wraps and delegates to the original service.   *   * @param {string} name The name of the service to decorate.   * @param {function()} decorator This function will be invoked when the service needs to be @@ -603,7 +615,7 @@ function createInjector(modulesToLoad) {        } else {          return delegate(key, value);        } -    } +    };    }    function provider(name, provider_) { @@ -625,7 +637,7 @@ function createInjector(modulesToLoad) {      }]);    } -  function value(name, value) { return factory(name, valueFn(value)); } +  function value(name, val) { return factory(name, valueFn(val)); }    function constant(name, value) {      assertNotHasOwnProperty(name, 'constant'); @@ -647,17 +659,17 @@ function createInjector(modulesToLoad) {    // Module Loading    ////////////////////////////////////    function loadModules(modulesToLoad){ -    var runBlocks = []; +    var runBlocks = [], moduleFn, invokeQueue, i, ii;      forEach(modulesToLoad, function(module) {        if (loadedModules.get(module)) return;        loadedModules.put(module, true);        try {          if (isString(module)) { -          var moduleFn = angularModule(module); +          moduleFn = angularModule(module);            runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); -          for(var invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; i < ii; i++) { +          for(invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; i < ii; i++) {              var invokeArgs = invokeQueue[i],                  provider = providerInjector.get(invokeArgs[0]); @@ -675,12 +687,15 @@ function createInjector(modulesToLoad) {            module = module[module.length - 1];          }          if (e.message && e.stack && e.stack.indexOf(e.message) == -1) { -          // Safari & FF's stack traces don't contain error.message content unlike those of Chrome and IE +          // Safari & FF's stack traces don't contain error.message content +          // unlike those of Chrome and IE            // So if stack doesn't contain message, we create a new string that contains both.            // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here. +          /* jshint -W022 */            e = e.message + '\n' + e.stack;          } -        throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}", module, e.stack || e.message || e); +        throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}", +                  module, e.stack || e.message || e);        }      });      return runBlocks; @@ -718,7 +733,8 @@ function createInjector(modulesToLoad) {        for(i = 0, length = $inject.length; i < length; i++) {          key = $inject[i];          if (typeof key !== 'string') { -          throw $injectorMinErr('itkn', 'Incorrect injection token! Expected service name as string, got {0}', key); +          throw $injectorMinErr('itkn', +                  'Incorrect injection token! Expected service name as string, got {0}', key);          }          args.push(            locals && locals.hasOwnProperty(key) @@ -743,8 +759,10 @@ function createInjector(modulesToLoad) {          case  6: return fn(args[0], args[1], args[2], args[3], args[4], args[5]);          case  7: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);          case  8: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); -        case  9: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]); -        case 10: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]); +        case  9: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], +          args[8]); +        case 10: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], +          args[8], args[9]);          default: return fn.apply(self, args);        }      } diff --git a/src/jqLite.js b/src/jqLite.js index ceec8d0b..727218a9 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -1,5 +1,13 @@  'use strict'; +/* global + +  -JQLitePrototype, +  -addEventListenerFn, +  -removeEventListenerFn, +  -BOOLEAN_ATTR +*/ +  //////////////////////////////////  //JQLite  ////////////////////////////////// @@ -122,13 +130,14 @@ function camelCase(name) {  //  ///////////////////////////////////////////// -function JQLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) { +function jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) {    var originalJqFn = jQuery.fn[name];    originalJqFn = originalJqFn.$original || originalJqFn;    removePatch.$original = originalJqFn;    jQuery.fn[name] = removePatch;    function removePatch(param) { +    // jshint -W040      var list = filterElems && param ? [this.filter(param)] : [this],          fireEvent = dispatchThis,          set, setIndex, setLength, @@ -174,30 +183,30 @@ function JQLite(element) {      // http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx      div.innerHTML = '<div> </div>' + element; // IE insanity to make NoScope elements work!      div.removeChild(div.firstChild); // remove the superfluous div -    JQLiteAddNodes(this, div.childNodes); +    jqLiteAddNodes(this, div.childNodes);      var fragment = jqLite(document.createDocumentFragment());      fragment.append(this); // detach the elements from the temporary DOM div.    } else { -    JQLiteAddNodes(this, element); +    jqLiteAddNodes(this, element);    }  } -function JQLiteClone(element) { +function jqLiteClone(element) {    return element.cloneNode(true);  } -function JQLiteDealoc(element){ -  JQLiteRemoveData(element); +function jqLiteDealoc(element){ +  jqLiteRemoveData(element);    for ( var i = 0, children = element.childNodes || []; i < children.length; i++) { -    JQLiteDealoc(children[i]); +    jqLiteDealoc(children[i]);    }  } -function JQLiteOff(element, type, fn, unsupported) { +function jqLiteOff(element, type, fn, unsupported) {    if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument'); -  var events = JQLiteExpandoStore(element, 'events'), -      handle = JQLiteExpandoStore(element, 'handle'); +  var events = jqLiteExpandoStore(element, 'events'), +      handle = jqLiteExpandoStore(element, 'handle');    if (!handle) return; //no listeners registered @@ -218,7 +227,7 @@ function JQLiteOff(element, type, fn, unsupported) {    }  } -function JQLiteRemoveData(element, name) { +function jqLiteRemoveData(element, name) {    var expandoId = element[jqName],        expandoStore = jqCache[expandoId]; @@ -230,14 +239,14 @@ function JQLiteRemoveData(element, name) {      if (expandoStore.handle) {        expandoStore.events.$destroy && expandoStore.handle({}, '$destroy'); -      JQLiteOff(element); +      jqLiteOff(element);      }      delete jqCache[expandoId];      element[jqName] = undefined; // ie does not allow deletion of attributes on elements.    }  } -function JQLiteExpandoStore(element, key, value) { +function jqLiteExpandoStore(element, key, value) {    var expandoId = element[jqName],        expandoStore = jqCache[expandoId || -1]; @@ -252,14 +261,14 @@ function JQLiteExpandoStore(element, key, value) {    }  } -function JQLiteData(element, key, value) { -  var data = JQLiteExpandoStore(element, 'data'), +function jqLiteData(element, key, value) { +  var data = jqLiteExpandoStore(element, 'data'),        isSetter = isDefined(value),        keyDefined = !isSetter && isDefined(key),        isSimpleGetter = keyDefined && !isObject(key);    if (!data && !isSimpleGetter) { -    JQLiteExpandoStore(element, 'data', data = {}); +    jqLiteExpandoStore(element, 'data', data = {});    }    if (isSetter) { @@ -278,13 +287,13 @@ function JQLiteData(element, key, value) {    }  } -function JQLiteHasClass(element, selector) { +function jqLiteHasClass(element, selector) {    if (!element.getAttribute) return false;    return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " ").        indexOf( " " + selector + " " ) > -1);  } -function JQLiteRemoveClass(element, cssClasses) { +function jqLiteRemoveClass(element, cssClasses) {    if (cssClasses && element.setAttribute) {      forEach(cssClasses.split(' '), function(cssClass) {        element.setAttribute('class', trim( @@ -296,7 +305,7 @@ function JQLiteRemoveClass(element, cssClasses) {    }  } -function JQLiteAddClass(element, cssClasses) { +function jqLiteAddClass(element, cssClasses) {    if (cssClasses && element.setAttribute) {      var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')                              .replace(/[\n\t]/g, " "); @@ -312,7 +321,7 @@ function JQLiteAddClass(element, cssClasses) {    }  } -function JQLiteAddNodes(root, elements) { +function jqLiteAddNodes(root, elements) {    if (elements) {      elements = (!elements.nodeName && isDefined(elements.length) && !isWindow(elements))        ? elements @@ -323,11 +332,11 @@ function JQLiteAddNodes(root, elements) {    }  } -function JQLiteController(element, name) { -  return JQLiteInheritedData(element, '$' + (name || 'ngController' ) + 'Controller'); +function jqLiteController(element, name) { +  return jqLiteInheritedData(element, '$' + (name || 'ngController' ) + 'Controller');  } -function JQLiteInheritedData(element, name, value) { +function jqLiteInheritedData(element, name, value) {    element = jqLite(element);    // if element is the document object work with the html element instead @@ -361,7 +370,9 @@ var JQLitePrototype = JQLite.prototype = {      } else {        this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9        // we can not use jqLite since we are not done loading and jQuery could be loaded later. +      // jshint -W064        JQLite(window).on('load', trigger); // fallback to window.onload for others +      // jshint +W064      }    },    toString: function() { @@ -403,24 +414,24 @@ function getBooleanAttrName(element, name) {  }  forEach({ -  data: JQLiteData, -  inheritedData: JQLiteInheritedData, +  data: jqLiteData, +  inheritedData: jqLiteInheritedData,    scope: function(element) { -    return JQLiteInheritedData(element, '$scope'); +    return jqLiteInheritedData(element, '$scope');    }, -  controller: JQLiteController , +  controller: jqLiteController ,    injector: function(element) { -    return JQLiteInheritedData(element, '$injector'); +    return jqLiteInheritedData(element, '$injector');    },    removeAttr: function(element,name) {      element.removeAttribute(name);    }, -  hasClass: JQLiteHasClass, +  hasClass: jqLiteHasClass,    css: function(element, name, value) {      name = camelCase(name); @@ -496,7 +507,7 @@ forEach({      return getText;      function getText(element, value) { -      var textProp = NODE_TYPE_TEXT_PROPERTY[element.nodeType] +      var textProp = NODE_TYPE_TEXT_PROPERTY[element.nodeType];        if (isUndefined(value)) {          return textProp ? element[textProp] : '';        } @@ -525,7 +536,7 @@ forEach({        return element.innerHTML;      }      for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) { -      JQLiteDealoc(childNodes[i]); +      jqLiteDealoc(childNodes[i]);      }      element.innerHTML = value;    } @@ -536,14 +547,14 @@ forEach({    JQLite.prototype[name] = function(arg1, arg2) {      var i, key; -    // JQLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it +    // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it      // in a way that survives minification. -    if (((fn.length == 2 && (fn !== JQLiteHasClass && fn !== JQLiteController)) ? arg1 : arg2) === undefined) { +    if (((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2) === undefined) {        if (isObject(arg1)) {          // we are a write, but the object properties are the key/values          for(i=0; i < this.length; i++) { -          if (fn === JQLiteData) { +          if (fn === jqLiteData) {              // data() takes the whole object in jQuery              fn(this[i], arg1);            } else { @@ -558,7 +569,7 @@ forEach({          // we are a read, so read the first child.          var value = fn.$dv;          // Only if we have $dv do we iterate over all, otherwise it is just the first element. -        var jj = value == undefined ? Math.min(this.length, 1) : this.length; +        var jj = (value === undefined) ? Math.min(this.length, 1) : this.length;          for (var j = 0; j < jj; j++) {            var nodeValue = fn(this[j], arg1, arg2);            value = value ? value + nodeValue : nodeValue; @@ -604,7 +615,7 @@ function createEventHandler(element, events) {      }      event.isDefaultPrevented = function() { -      return event.defaultPrevented || event.returnValue == false; +      return event.defaultPrevented || event.returnValue === false;      };      forEach(events[type || event.type], function(fn) { @@ -635,18 +646,18 @@ function createEventHandler(element, events) {  // selector.  //////////////////////////////////////////  forEach({ -  removeData: JQLiteRemoveData, +  removeData: jqLiteRemoveData, -  dealoc: JQLiteDealoc, +  dealoc: jqLiteDealoc,    on: function onFn(element, type, fn, unsupported){      if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters'); -    var events = JQLiteExpandoStore(element, 'events'), -        handle = JQLiteExpandoStore(element, 'handle'); +    var events = jqLiteExpandoStore(element, 'events'), +        handle = jqLiteExpandoStore(element, 'handle'); -    if (!events) JQLiteExpandoStore(element, 'events', events = {}); -    if (!handle) JQLiteExpandoStore(element, 'handle', handle = createEventHandler(element, events)); +    if (!events) jqLiteExpandoStore(element, 'events', events = {}); +    if (!handle) jqLiteExpandoStore(element, 'handle', handle = createEventHandler(element, events));      forEach(type.split(' '), function(type){        var eventFns = events[type]; @@ -655,6 +666,7 @@ forEach({          if (type == 'mouseenter' || type == 'mouseleave') {            var contains = document.body.contains || document.body.compareDocumentPosition ?            function( a, b ) { +            // jshint bitwise: false              var adown = a.nodeType === 9 ? a.documentElement : a,              bup = b && b.parentNode;              return a === bup || !!( bup && bup.nodeType === 1 && ( @@ -694,17 +706,17 @@ forEach({            addEventListenerFn(element, type, handle);            events[type] = [];          } -        eventFns = events[type] +        eventFns = events[type];        }        eventFns.push(fn);      });    }, -  off: JQLiteOff, +  off: jqLiteOff,    replaceWith: function(element, replaceNode) {      var index, parent = element.parentNode; -    JQLiteDealoc(element); +    jqLiteDealoc(element);      forEach(new JQLite(replaceNode), function(node){        if (index) {          parent.insertBefore(node, index.nextSibling); @@ -755,7 +767,7 @@ forEach({    },    remove: function(element) { -    JQLiteDealoc(element); +    jqLiteDealoc(element);      var parent = element.parentNode;      if (parent) parent.removeChild(element);    }, @@ -768,14 +780,14 @@ forEach({      });    }, -  addClass: JQLiteAddClass, -  removeClass: JQLiteRemoveClass, +  addClass: jqLiteAddClass, +  removeClass: jqLiteRemoveClass,    toggleClass: function(element, selector, condition) {      if (isUndefined(condition)) { -      condition = !JQLiteHasClass(element, selector); +      condition = !jqLiteHasClass(element, selector);      } -    (condition ? JQLiteAddClass : JQLiteRemoveClass)(element, selector); +    (condition ? jqLiteAddClass : jqLiteRemoveClass)(element, selector);    },    parent: function(element) { @@ -800,10 +812,10 @@ forEach({      return element.getElementsByTagName(selector);    }, -  clone: JQLiteClone, +  clone: jqLiteClone,    triggerHandler: function(element, eventName, eventData) { -    var eventFns = (JQLiteExpandoStore(element, 'events') || {})[eventName]; +    var eventFns = (jqLiteExpandoStore(element, 'events') || {})[eventName];      eventData = eventData || []; @@ -823,17 +835,17 @@ forEach({    JQLite.prototype[name] = function(arg1, arg2, arg3) {      var value;      for(var i=0; i < this.length; i++) { -      if (value == undefined) { +      if (isUndefined(value)) {          value = fn(this[i], arg1, arg2, arg3); -        if (value !== undefined) { +        if (isDefined(value)) {            // any function which returns a value needs to be wrapped            value = jqLite(value);          }        } else { -        JQLiteAddNodes(value, fn(this[i], arg1, arg2, arg3)); +        jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));        }      } -    return value == undefined ? this : value; +    return isDefined(value) ? value : this;    };    // bind legacy bind/unbind to on/off diff --git a/src/loader.js b/src/loader.js index 7c7d3082..0560595d 100644 --- a/src/loader.js +++ b/src/loader.js @@ -25,7 +25,8 @@ function setupModuleLoader(window) {       * @name angular.module       * @description       * -     * The `angular.module` is a global place for creating, registering and retrieving Angular modules. +     * The `angular.module` is a global place for creating, registering and retrieving Angular +     * modules.       * All modules (angular core or 3rd party) that should be available to an application must be       * registered using this mechanism.       * @@ -63,8 +64,8 @@ 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 -     *        the module is being retrieved for further configuration. +     * @param {Array.<string>=} requires If specified then new module is being created. If +     *        unspecified then the the module is being retrieved for further configuration.       * @param {Function} configFn Optional configuration function for the module. Same as       *        {@link angular.Module#methods_config Module#config()}.       * @returns {module} new module with the {@link angular.Module} api. @@ -76,9 +77,9 @@ function setupModuleLoader(window) {        }        return ensure(modules, name, function() {          if (!requires) { -          throw $injectorMinErr('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); +          throw $injectorMinErr('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.<*>>} */ @@ -101,7 +102,8 @@ function setupModuleLoader(window) {             * @propertyOf angular.Module             * @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. +           * Holds the list of modules which the injector will load before the current module is +           * loaded.             */            requires: requires, @@ -120,7 +122,8 @@ function setupModuleLoader(window) {             * @name angular.Module#provider             * @methodOf angular.Module             * @param {string} name service name -           * @param {Function} providerType Construction function for creating new instance of the service. +           * @param {Function} providerType Construction function for creating new instance of the +           *                                service.             * @description             * See {@link AUTO.$provide#provider $provide.provider()}.             */ @@ -176,14 +179,15 @@ function setupModuleLoader(window) {             * @name angular.Module#animation             * @methodOf angular.Module             * @param {string} name animation name -           * @param {Function} animationFactory Factory function for creating new instance of an animation. +           * @param {Function} animationFactory Factory function for creating new instance of an +           *                                    animation.             * @description             *             * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.             *             * -           * Defines an animation hook that can be later used with {@link ngAnimate.$animate $animate} service and -           * directives that use this service. +           * Defines an animation hook that can be later used with +           * {@link ngAnimate.$animate $animate} service and directives that use this service.             *             * <pre>             * module.animation('.animation-name', function($inject1, $inject2) { @@ -283,7 +287,7 @@ function setupModuleLoader(window) {            return function() {              invokeQueue[insertMethod || 'push']([provider, method, arguments]);              return moduleInstance; -          } +          };          }        });      }; diff --git a/src/ng/anchorScroll.js b/src/ng/anchorScroll.js index 263562bf..4cef2bdf 100644 --- a/src/ng/anchorScroll.js +++ b/src/ng/anchorScroll.js @@ -1,3 +1,5 @@ +'use strict'; +  /**   * @ngdoc function   * @name ng.$anchorScroll diff --git a/src/ng/animate.js b/src/ng/animate.js index 1756e7d1..bb08410c 100644 --- a/src/ng/animate.js +++ b/src/ng/animate.js @@ -7,7 +7,8 @@ var $animateMinErr = minErr('$animate');   * @name ng.$animateProvider   *   * @description - * Default implementation of $animate that doesn't perform any animations, instead just synchronously performs DOM + * Default implementation of $animate that doesn't perform any animations, instead just + * synchronously performs DOM   * updates and calls done() callbacks.   *   * In order to enable animations the ngAnimate module has to be loaded. @@ -16,6 +17,7 @@ var $animateMinErr = minErr('$animate');   */  var $AnimateProvider = ['$provide', function($provide) { +      this.$$selectors = {}; @@ -25,12 +27,14 @@ var $AnimateProvider = ['$provide', function($provide) {     * @methodOf ng.$animateProvider     *     * @description -   * Registers a new injectable animation factory function. The factory function produces the animation object which -   * contains callback functions for each event that is expected to be animated. +   * Registers a new injectable animation factory function. The factory function produces the +   * animation object which contains callback functions for each event that is expected to be +   * animated.     * -   *   * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction` must be called once the -   *   element animation is complete. If a function is returned then the animation service will use this function to -   *   cancel the animation whenever a cancel event is triggered. +   *   * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction` +   *   must be called once the element animation is complete. If a function is returned then the +   *   animation service will use this function to cancel the animation whenever a cancel event is +   *   triggered.     *     *     *<pre> @@ -46,7 +50,8 @@ var $AnimateProvider = ['$provide', function($provide) {     *</pre>     *     * @param {string} name The name of the animation. -   * @param {function} factory The factory function that will be executed to return the animation object. +   * @param {function} factory The factory function that will be executed to return the animation +   *                           object.     */    this.register = function(name, factory) {      var key = name + '-animation'; @@ -59,36 +64,39 @@ var $AnimateProvider = ['$provide', function($provide) {    this.$get = ['$timeout', function($timeout) {      /** +     *       * @ngdoc object       * @name ng.$animate +     * @description The $animate service provides rudimentary DOM manipulation functions to +     * insert, remove and move elements within the DOM, as well as adding and removing classes. +     * This service is the core service used by the ngAnimate $animator service which provides +     * high-level animation hooks for CSS and JavaScript.       * -     * @description -     * The $animate service provides rudimentary DOM manipulation functions to insert, remove and move elements within -     * the DOM, as well as adding and removing classes. This service is the core service used by the ngAnimate $animator -     * service which provides high-level animation hooks for CSS and JavaScript.  -     * -     * $animate is available in the AngularJS core, however, the ngAnimate module must be included to enable full out -     * animation support. Otherwise, $animate will only perform simple DOM manipulation operations. +     * $animate is available in the AngularJS core, however, the ngAnimate module must be included +     * to enable full out animation support. Otherwise, $animate will only perform simple DOM +     * manipulation operations.       * -     * To learn more about enabling animation support, click here to visit the {@link ngAnimate ngAnimate module page} -     * as well as the {@link ngAnimate.$animate ngAnimate $animate service page}. +     * To learn more about enabling animation support, click here to visit the {@link ngAnimate +     * ngAnimate module page} as well as the {@link ngAnimate.$animate ngAnimate $animate service +     * page}.       */      return {        /** +       *         * @ngdoc function         * @name ng.$animate#enter         * @methodOf ng.$animate         * @function -       * -       * @description -       * Inserts the element into the DOM either after the `after` element or within the `parent` element. Once complete, -       * the done() callback will be fired (if provided). -       * +       * @description Inserts the element into the DOM either after the `after` element or within +       *   the `parent` element. Once complete, the done() callback will be fired (if provided).         * @param {jQuery/jqLite element} element the element which will be inserted into the DOM -       * @param {jQuery/jqLite element} parent the parent element which will append the element as a child (if the after element is not present) -       * @param {jQuery/jqLite element} after the sibling element which will append the element after itself -       * @param {function=} done callback function that will be called after the element has been inserted into the DOM +       * @param {jQuery/jqLite element} parent the parent element which will append the element as +       *   a child (if the after element is not present) +       * @param {jQuery/jqLite element} after the sibling element which will append the element +       *   after itself +       * @param {function=} done callback function that will be called after the element has been +       *   inserted into the DOM         */        enter : function(element, parent, after, done) {          var afterNode = after && after[after.length - 1]; @@ -102,16 +110,16 @@ var $AnimateProvider = ['$provide', function($provide) {        },        /** +       *         * @ngdoc function         * @name ng.$animate#leave         * @methodOf ng.$animate         * @function -       * -       * @description -       * Removes the element from the DOM. Once complete, the done() callback will be fired (if provided). -       * +       * @description Removes the element from the DOM. Once complete, the done() callback will be +       *   fired (if provided).         * @param {jQuery/jqLite element} element the element which will be removed from the DOM -       * @param {function=} done callback function that will be called after the element has been removed from the DOM +       * @param {function=} done callback function that will be called after the element has been +       *   removed from the DOM         */        leave : function(element, done) {          element.remove(); @@ -119,19 +127,23 @@ var $AnimateProvider = ['$provide', function($provide) {        },        /** +       *         * @ngdoc function         * @name ng.$animate#move         * @methodOf ng.$animate         * @function -       * -       * @description -       * Moves the position of the provided element within the DOM to be placed either after the `after` element or inside of the `parent` element. -       * Once complete, the done() callback will be fired (if provided). -       * -       * @param {jQuery/jqLite element} element the element which will be moved around within the DOM -       * @param {jQuery/jqLite element} parent the parent element where the element will be inserted into (if the after element is not present) -       * @param {jQuery/jqLite element} after the sibling element where the element will be positioned next to -       * @param {function=} done the callback function (if provided) that will be fired after the element has been moved to its new position +       * @description Moves the position of the provided element within the DOM to be placed +       * either after the `after` element or inside of the `parent` element. Once complete, the +       * done() callback will be fired (if provided). +       *  +       * @param {jQuery/jqLite element} element the element which will be moved around within the +       *   DOM +       * @param {jQuery/jqLite element} parent the parent element where the element will be +       *   inserted into (if the after element is not present) +       * @param {jQuery/jqLite element} after the sibling element where the element will be +       *   positioned next to +       * @param {function=} done the callback function (if provided) that will be fired after the +       *   element has been moved to its new position         */        move : function(element, parent, after, done) {          // Do not remove element before insert. Removing will cause data associated with the @@ -140,47 +152,49 @@ var $AnimateProvider = ['$provide', function($provide) {        },        /** +       *         * @ngdoc function         * @name ng.$animate#addClass         * @methodOf ng.$animate         * @function -       * -       * @description -       * Adds the provided className CSS class value to the provided element. Once complete, the done() callback will be fired (if provided). -       * -       * @param {jQuery/jqLite element} element the element which will have the className value added to it +       * @description Adds the provided className CSS class value to the provided element. Once +       * complete, the done() callback will be fired (if provided). +       * @param {jQuery/jqLite element} element the element which will have the className value +       *   added to it         * @param {string} className the CSS class which will be added to the element -       * @param {function=} done the callback function (if provided) that will be fired after the className value has been added to the element +       * @param {function=} done the callback function (if provided) that will be fired after the +       *   className value has been added to the element         */        addClass : function(element, className, done) {          className = isString(className) ?                        className :                        isArray(className) ? className.join(' ') : '';          forEach(element, function (element) { -          JQLiteAddClass(element, className); +          jqLiteAddClass(element, className);          });          done && $timeout(done, 0, false);        },        /** +       *         * @ngdoc function         * @name ng.$animate#removeClass         * @methodOf ng.$animate         * @function -       * -       * @description -       * Removes the provided className CSS class value from the provided element. Once complete, the done() callback will be fired (if provided). -       * -       * @param {jQuery/jqLite element} element the element which will have the className value removed from it +       * @description Removes the provided className CSS class value from the provided element. +       * Once complete, the done() callback will be fired (if provided). +       * @param {jQuery/jqLite element} element the element which will have the className value +       *   removed from it         * @param {string} className the CSS class which will be removed from the element -       * @param {function=} done the callback function (if provided) that will be fired after the className value has been removed from the element +       * @param {function=} done the callback function (if provided) that will be fired after the +       *   className value has been removed from the element         */        removeClass : function(element, className, done) {          className = isString(className) ?                        className :                        isArray(className) ? className.join(' ') : '';          forEach(element, function (element) { -          JQLiteRemoveClass(element, className); +          jqLiteRemoveClass(element, className);          });          done && $timeout(done, 0, false);        }, diff --git a/src/ng/browser.js b/src/ng/browser.js index 7a0e3fec..5e52b828 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -274,30 +274,35 @@ function Browser(window, document, $log, $sniffer) {     * It is not meant to be used directly, use the $cookie service instead.     *     * The return values vary depending on the arguments that the method was called with as follows: -   * <ul> -   *   <li>cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify it</li> -   *   <li>cookies(name, value) -> set name to value, if value is undefined delete the cookie</li> -   *   <li>cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that way)</li> -   * </ul> -   * +   *  +   * - cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify +   *   it +   * - cookies(name, value) -> set name to value, if value is undefined delete the cookie +   * - cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that +   *   way) +   *      * @returns {Object} Hash of all cookies (if called without any parameter)     */    self.cookies = function(name, value) { +    /* global escape: false, unescape: false */      var cookieLength, cookieArray, cookie, i, index;      if (name) {        if (value === undefined) { -        rawDocument.cookie = escape(name) + "=;path=" + cookiePath + ";expires=Thu, 01 Jan 1970 00:00:00 GMT"; +        rawDocument.cookie = escape(name) + "=;path=" + cookiePath + +                                ";expires=Thu, 01 Jan 1970 00:00:00 GMT";        } else {          if (isString(value)) { -          cookieLength = (rawDocument.cookie = escape(name) + '=' + escape(value) + ';path=' + cookiePath).length + 1; +          cookieLength = (rawDocument.cookie = escape(name) + '=' + escape(value) + +                                ';path=' + cookiePath).length + 1;            // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:            // - 300 cookies            // - 20 cookies per unique domain            // - 4096 bytes per cookie            if (cookieLength > 4096) { -            $log.warn("Cookie '"+ name +"' possibly not set or overflowed because it was too large ("+ +            $log.warn("Cookie '"+ name + +              "' possibly not set or overflowed because it was too large ("+                cookieLength + " > 4096 bytes)!");            }          } @@ -312,7 +317,7 @@ function Browser(window, document, $log, $sniffer) {            cookie = cookieArray[i];            index = cookie.indexOf('=');            if (index > 0) { //ignore nameless cookies -            var name = unescape(cookie.substring(0, index)); +            name = unescape(cookie.substring(0, index));              // the first value that is seen for a cookie is the most              // specific one.  values for the same cookie name that              // follow are for less specific paths. @@ -362,7 +367,8 @@ function Browser(window, document, $log, $sniffer) {     * Cancels a deferred task identified with `deferId`.     *     * @param {*} deferId Token returned by the `$browser.defer` function. -   * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully canceled. +   * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully +   *                    canceled.     */    self.defer.cancel = function(deferId) {      if (pendingDeferIds[deferId]) { diff --git a/src/ng/cacheFactory.js b/src/ng/cacheFactory.js index 1a0cb549..0e887c81 100644 --- a/src/ng/cacheFactory.js +++ b/src/ng/cacheFactory.js @@ -1,3 +1,5 @@ +'use strict'; +  /**   * @ngdoc object   * @name ng.$cacheFactory @@ -13,8 +15,9 @@   *   *  cache.put("key", "value");   *  cache.put("another key", "another value"); - *  - *  expect(cache.info()).toEqual({id: 'cacheId', size: 2}); // Since we've specified no options on creation + * + *  // We've specified no options on creation + *  expect(cache.info()).toEqual({id: 'cacheId', size: 2});    *    * </pre>   * @@ -27,7 +30,8 @@   * @returns {object} Newly created cache object with the following set of methods:   *   * - `{object}` `info()` — Returns id, size, and options of cache. - * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns it. + * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns + *   it.   * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.   * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.   * - `{void}` `removeAll()` — Removes all cached values. @@ -194,9 +198,9 @@ function $CacheFactoryProvider() {   * @name ng.$templateCache   *   * @description - * The first time a template is used, it is loaded in the template cache for quick retrieval. You can - * load templates directly into the cache in a `script` tag, or by consuming the `$templateCache` - * service directly. + * The first time a template is used, it is loaded in the template cache for quick retrieval. You + * can load templates directly into the cache in a `script` tag, or by consuming the + * `$templateCache` service directly.   *    * Adding via the `script` tag:   * <pre> @@ -210,8 +214,8 @@ function $CacheFactoryProvider() {   * </html>   * </pre>   *  - * **Note:** the `script` tag containing the template does not need to be included in the `head` of the document, but  - * it must be below the `ng-app` definition. + * **Note:** the `script` tag containing the template does not need to be included in the `head` of + * the document, but it must be below the `ng-app` definition.   *    * Adding via the $templateCache service:   *  diff --git a/src/ng/compile.js b/src/ng/compile.js index 84546f39..7476b46b 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -97,16 +97,16 @@   * (a DOM element/tree) to a scope. Where:   *   *  * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. - *  * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the `template` - *  and call the `cloneAttachFn` function allowing the caller to attach the + *  * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the + *  `template` and call the `cloneAttachFn` function allowing the caller to attach the   *  cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is   *  called as: <br> `cloneAttachFn(clonedElement, scope)` where:   *   *      * `clonedElement` - is a clone of the original `element` passed into the compiler.   *      * `scope` - is the current scope with which the linking function is working with.   * - * Calling the linking function returns the element of the template. It is either the original element - * passed in, or the clone of the element if the `cloneAttachFn` is provided. + * Calling the linking function returns the element of the template. It is either the original + * element passed in, or the clone of the element if the `cloneAttachFn` is provided.   *   * After linking the view is not updated until after a call to $digest which typically is done by   * Angular automatically. @@ -257,10 +257,10 @@ function $CompileProvider($provide) {     *     * The sanitization is a security measure aimed at prevent XSS attacks via html links.     * -   * Any url about to be assigned to img[src] via data-binding is first normalized and turned into an -   * absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` regular -   * expression. If a match is found, the original url is written into the dom. Otherwise, the -   * absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. +   * Any url about to be assigned to img[src] via data-binding is first normalized and turned into +   * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` +   * regular expression. If a match is found, the original url is written into the dom. Otherwise, +   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.     *     * @param {RegExp=} regexp New regexp to whitelist urls with.     * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for @@ -315,8 +315,8 @@ function $CompileProvider($provide) {         * @function         *         * @description -       * Removes the CSS class value specified by the classVal parameter from the element. If animations -       * are enabled then an animation will be triggered for the class removal. +       * Removes the CSS class value specified by the classVal parameter from the element. If +       * animations are enabled then an animation will be triggered for the class removal.         *         * @param {string} classVal The className value that will be removed from the element         */ @@ -416,7 +416,7 @@ function $CompileProvider($provide) {              values.push(token);            }            return values; -        }; +        }        }, @@ -469,9 +469,11 @@ function $CompileProvider($provide) {      //================================ -    function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) { +    function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, +                        previousCompileContext) {        if (!($compileNodes instanceof jqLite)) { -        // jquery always rewraps, whereas we need to preserve the original selector so that we can modify it. +        // jquery always rewraps, whereas we need to preserve the original selector so that we can +        // modify it.          $compileNodes = jqLite($compileNodes);        }        // We can not compile top level text elements since text nodes can be merged and we will @@ -481,7 +483,9 @@ function $CompileProvider($provide) {            $compileNodes[index] = node = jqLite(node).wrap('<span></span>').parent()[0];          }        }); -      var compositeLinkFn = compileNodes($compileNodes, transcludeFn, $compileNodes, maxPriority, ignoreDirective, previousCompileContext); +      var compositeLinkFn = +              compileNodes($compileNodes, transcludeFn, $compileNodes, +                           maxPriority, ignoreDirective, previousCompileContext);        return function publicLinkFn(scope, cloneConnectFn){          assertArg(scope, 'scope');          // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart @@ -522,13 +526,14 @@ function $CompileProvider($provide) {       * @param {NodeList} nodeList an array of nodes or NodeList to compile       * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the       *        scope argument is auto-generated to the new child of the transcluded parent scope. -     * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then the -     *        rootElement must be set the jqLite collection of the compile root. This is +     * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then +     *        the rootElement must be set the jqLite collection of the compile root. This is       *        needed so that the jqLite collection items can be replaced with widgets.       * @param {number=} max directive priority       * @returns {?function} A composite linking function of all of the matched directives or null.       */ -    function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective, previousCompileContext) { +    function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective, +                            previousCompileContext) {        var linkFns = [],            nodeLinkFn, childLinkFn, directives, attrs, linkFnFound; @@ -536,13 +541,17 @@ function $CompileProvider($provide) {          attrs = new Attributes();          // we must always refer to nodeList[i] since the nodes can be replaced underneath us. -        directives = collectDirectives(nodeList[i], [], attrs, i == 0 ? maxPriority : undefined, ignoreDirective); +        directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined, +                                        ignoreDirective);          nodeLinkFn = (directives.length) -            ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, null, [], [], previousCompileContext) +            ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, +                                      null, [], [], previousCompileContext)              : null; -        childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || !nodeList[i].childNodes || !nodeList[i].childNodes.length) +        childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || +                      !nodeList[i].childNodes || +                      !nodeList[i].childNodes.length)              ? null              : compileNodes(nodeList[i].childNodes,                   nodeLinkFn ? nodeLinkFn.transclude : transcludeFn); @@ -550,7 +559,8 @@ function $CompileProvider($provide) {          linkFns.push(nodeLinkFn);          linkFns.push(childLinkFn);          linkFnFound = (linkFnFound || nodeLinkFn || childLinkFn); -        previousCompileContext = null; //use the previous context only for the first element in the virtual group +        //use the previous context only for the first element in the virtual group +        previousCompileContext = null;        }        // return a linking function if we have found anything, null otherwise @@ -654,7 +664,8 @@ function $CompileProvider($provide) {                  attrs[nName] = true; // presence means true                }                addAttrInterpolateDirective(node, directives, value, nName); -              addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, attrEndName); +              addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, +                            attrEndName);              }            } @@ -683,7 +694,8 @@ function $CompileProvider($provide) {                }              }            } catch (e) { -            // turns out that under some circumstances IE9 throws errors when one attempts to read comment's node value. +            // turns out that under some circumstances IE9 throws errors when one attempts to read +            // comment's node value.              // Just ignore it and continue. (Can't seem to reproduce in test case.)            }            break; @@ -694,7 +706,8 @@ function $CompileProvider($provide) {      }      /** -     * Given a node with an directive-start it collects all of the siblings until it find directive-end. +     * Given a node with an directive-start it collects all of the siblings until it finds +     * directive-end.       * @param node       * @param attrStart       * @param attrEnd @@ -707,7 +720,9 @@ function $CompileProvider($provide) {          var startNode = node;          do {            if (!node) { -            throw $compileMinErr('uterdir', "Unterminated attribute, found '{0}' but no matching '{1}' found.", attrStart, attrEnd); +            throw $compileMinErr('uterdir', +                      "Unterminated attribute, found '{0}' but no matching '{1}' found.", +                      attrStart, attrEnd);            }            if (node.nodeType == 1 /** Element **/) {              if (node.hasAttribute(attrStart)) depth++; @@ -735,7 +750,7 @@ function $CompileProvider($provide) {        return function(scope, element, attrs, controllers) {          element = groupScan(element[0], attrStart, attrEnd);          return linkFn(scope, element, attrs, controllers); -      } +      };      }      /** @@ -748,18 +763,22 @@ function $CompileProvider($provide) {       * @param {Node} compileNode The raw DOM node to apply the compile functions to       * @param {Object} templateAttrs The shared attribute function       * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the -     *        scope argument is auto-generated to the new child of the transcluded parent scope. +     *                                                  scope argument is auto-generated to the new +     *                                                  child of the transcluded parent scope.       * @param {JQLite} jqCollection If we are working on the root of the compile tree then this -     *        argument has the root jqLite array so that we can replace nodes on it. -     * @param {Object=} originalReplaceDirective An optional directive that will be ignored when compiling -     *        the transclusion. +     *                              argument has the root jqLite array so that we can replace nodes +     *                              on it. +     * @param {Object=} originalReplaceDirective An optional directive that will be ignored when +     *                                           compiling the transclusion.       * @param {Array.<Function>} preLinkFns       * @param {Array.<Function>} postLinkFns -     * @param {Object} previousCompileContext Context used for previous compilation of the current node +     * @param {Object} previousCompileContext Context used for previous compilation of the current +     *                                        node       * @returns linkFn       */ -    function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, jqCollection, -        originalReplaceDirective, preLinkFns, postLinkFns, previousCompileContext) { +    function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, +                                   jqCollection, originalReplaceDirective, preLinkFns, postLinkFns, +                                   previousCompileContext) {        previousCompileContext = previousCompileContext || {};        var terminalPriority = -Number.MAX_VALUE, @@ -785,7 +804,7 @@ function $CompileProvider($provide) {          // collect multiblock sections          if (attrStart) { -          $compileNode = groupScan(compileNode, attrStart, attrEnd) +          $compileNode = groupScan(compileNode, attrStart, attrEnd);          }          $template = undefined; @@ -796,10 +815,11 @@ function $CompileProvider($provide) {          if (directiveValue = directive.scope) {            newScopeDirective = newScopeDirective || directive; -          // skip the check for directives with async templates, we'll check the derived sync directive when -          // the template arrives +          // skip the check for directives with async templates, we'll check the derived sync +          // directive when the template arrives            if (!directive.templateUrl) { -            assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive, $compileNode); +            assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive, +                              $compileNode);              if (isObject(directiveValue)) {                safeAddClass($compileNode, 'ng-isolate-scope');                newIsolateScopeDirective = directive; @@ -819,8 +839,8 @@ function $CompileProvider($provide) {          }          if (directiveValue = directive.transclude) { -          // Special case ngRepeat so that we don't complain about duplicate transclusion, ngRepeat knows how to handle -          // this on its own. +          // Special case ngRepeat so that we don't complain about duplicate transclusion, ngRepeat +          // knows how to handle this on its own.            if (directiveName !== 'ngRepeat') {              assertNoDuplicate('transclusion', transcludeDirective, directive, $compileNode);              transcludeDirective = directive; @@ -830,7 +850,8 @@ function $CompileProvider($provide) {              terminalPriority = directive.priority;              $template = groupScan(compileNode, attrStart, attrEnd);              $compileNode = templateAttrs.$$element = -                jqLite(document.createComment(' ' + directiveName + ': ' + templateAttrs[directiveName] + ' ')); +                jqLite(document.createComment(' ' + directiveName + ': ' + +                                              templateAttrs[directiveName] + ' '));              compileNode = $compileNode[0];              replaceWith(jqCollection, jqLite(sliceArgs($template)), compileNode); @@ -841,7 +862,7 @@ function $CompileProvider($provide) {                                            templateDirective: templateDirective                                          });            } else { -            $template = jqLite(JQLiteClone(compileNode)).contents(); +            $template = jqLite(jqLiteClone(compileNode)).contents();              $compileNode.html(''); // clear contents              childTranscludeFn = compile($template, transcludeFn);            } @@ -865,7 +886,9 @@ function $CompileProvider($provide) {              compileNode = $template[0];              if ($template.length != 1 || compileNode.nodeType !== 1) { -              throw $compileMinErr('tplrt', "Template for directive '{0}' must have exactly one root element. {1}", directiveName, ''); +              throw $compileMinErr('tplrt', +                  "Template for directive '{0}' must have exactly one root element. {1}", +                  directiveName, '');              }              replaceWith(jqCollection, $compileNode, compileNode); @@ -968,7 +991,9 @@ function $CompileProvider($provide) {            }            if (!value && !optional) { -            throw $compileMinErr('ctreq', "Controller '{0}', required by directive '{1}', can't be found!", require, directiveName); +            throw $compileMinErr('ctreq', +                "Controller '{0}', required by directive '{1}', can't be found!", +                require, directiveName);            }            return value;          } else if (isArray(require)) { @@ -1008,19 +1033,19 @@ function $CompileProvider($provide) {              switch (mode) { -              case '@': { +              case '@':                  attrs.$observe(attrName, function(value) {                    scope[scopeName] = value;                  });                  attrs.$$observers[attrName].$$scope = parentScope;                  if( attrs[attrName] ) { -                  // If the attribute has been provided then we trigger an interpolation to ensure the value is there for use in the link fn +                  // If the attribute has been provided then we trigger an interpolation to ensure +                  // the value is there for use in the link fn                    scope[scopeName] = $interpolate(attrs[attrName])(parentScope);                  }                  break; -              } -              case '=': { +              case '=':                  if (optional && !attrs[attrName]) {                    return;                  } @@ -1028,7 +1053,8 @@ function $CompileProvider($provide) {                  parentSet = parentGet.assign || function() {                    // reset the change, or we will throw this exception on every $digest                    lastValue = scope[scopeName] = parentGet(parentScope); -                  throw $compileMinErr('nonassign', "Expression '{0}' used with directive '{1}' is non-assignable!", +                  throw $compileMinErr('nonassign', +                      "Expression '{0}' used with directive '{1}' is non-assignable!",                        attrs[attrName], newIsolateScopeDirective.name);                  };                  lastValue = scope[scopeName] = parentGet(parentScope); @@ -1048,20 +1074,19 @@ function $CompileProvider($provide) {                    return parentValue;                  });                  break; -              } -              case '&': { +              case '&':                  parentGet = $parse(attrs[attrName]);                  scope[scopeName] = function(locals) {                    return parentGet(parentScope, locals);                  };                  break; -              } - -              default: { -                throw $compileMinErr('iscp', "Invalid isolate scope definition for directive '{0}'. Definition: {... {1}: '{2}' ...}", +               +              default: +                throw $compileMinErr('iscp', +                    "Invalid isolate scope definition for directive '{0}'." + +                    " Definition: {... {1}: '{2}' ...}",                      newIsolateScopeDirective.name, scopeName, definition); -              }              }            });          } @@ -1139,7 +1164,8 @@ function $CompileProvider($provide) {       *   * `M`: comment       * @returns true if directive was added.       */ -    function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, endAttrName) { +    function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, +                          endAttrName) {        if (name === ignoreDirective) return null;        var match = null;        if (hasDirectives.hasOwnProperty(name)) { @@ -1231,7 +1257,8 @@ function $CompileProvider($provide) {              compileNode = $template[0];              if ($template.length != 1 || compileNode.nodeType !== 1) { -              throw $compileMinErr('tplrt', "Template for directive '{0}' must have exactly one root element. {1}", +              throw $compileMinErr('tplrt', +                  "Template for directive '{0}' must have exactly one root element. {1}",                    origAsyncDirective.name, templateUrl);              } @@ -1247,7 +1274,8 @@ function $CompileProvider($provide) {            directives.unshift(derivedSyncDirective);            afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, -              childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns, previousCompileContext); +              childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns, +              previousCompileContext);            forEach($rootElement, function(node, i) {              if (node == compileNode) {                $rootElement[i] = $compileNode[0]; @@ -1265,11 +1293,12 @@ function $CompileProvider($provide) {              if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {                // it was cloned therefore we have to clone as well. -              linkNode = JQLiteClone(compileNode); +              linkNode = jqLiteClone(compileNode);                replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);              } -            afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, controller); +            afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, +                                    controller);            }            linkQueue = null;          }). @@ -1346,7 +1375,8 @@ function $CompileProvider($provide) {        if (name === "multiple" && nodeName_(node) === "SELECT") { -        throw $compileMinErr("selmulti", "Binding to the 'multiple' attribute is not supported. Element: {0}", +        throw $compileMinErr("selmulti", +            "Binding to the 'multiple' attribute is not supported. Element: {0}",              startingTag(node));        } @@ -1357,8 +1387,8 @@ function $CompileProvider($provide) {            if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {              throw $compileMinErr('nodomevents', -                "Interpolations for HTML DOM event attributes are disallowed.  Please use the ng- " + -                "versions (such as ng-click instead of onclick) instead."); +                "Interpolations for HTML DOM event attributes are disallowed.  Please use the " + +                "ng- versions (such as ng-click instead of onclick) instead.");            }            // we need to interpolate again, in case the attribute value has been updated @@ -1369,7 +1399,8 @@ function $CompileProvider($provide) {            // register any observers            if (!interpolateFn) return; -          // TODO(i): this should likely be attr.$set(name, iterpolateFn(scope) so that we reset the actual attr value +          // TODO(i): this should likely be attr.$set(name, iterpolateFn(scope) so that we reset the +          // actual attr value            attr[name] = interpolateFn(scope);            ($$observers[name] || ($$observers[name] = [])).$$inter = true;            (attr.$$observers && attr.$$observers[name].$$scope || scope). @@ -1386,9 +1417,9 @@ function $CompileProvider($provide) {       * have no parents, provided that the containing jqLite collection is provided.       *       * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes -     *    in the root of the tree. -     * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep the shell, -     *    but replace its DOM node reference. +     *                               in the root of the tree. +     * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep +     *                                  the shell, but replace its DOM node reference.       * @param {Node} newNode The new DOM node.       */      function replaceWith($rootElement, elementsToRemove, newNode) { @@ -1430,7 +1461,7 @@ function $CompileProvider($provide) {        }        elementsToRemove[0] = newNode; -      elementsToRemove.length = 1 +      elementsToRemove.length = 1;      }    }];  } @@ -1454,13 +1485,13 @@ function directiveNormalize(name) {  /**   * @ngdoc object   * @name ng.$compile.directive.Attributes + *    * @description + * A shared object between directive compile / linking functions which contains normalized DOM + * element attributes. The the values reflect current binding state `{{ }}`. The normalization is + * needed since all of these are treated as equivalent in Angular:   * - * A shared object between directive compile / linking functions which contains normalized DOM element - * attributes. The the values reflect current binding state `{{ }}`. The normalization is needed - * since all of these are treated as equivalent in Angular: - * - *          <span ng:bind="a" ng-bind="a" data-ng-bind="a" x-ng-bind="a"> + *    <span ng:bind="a" ng-bind="a" data-ng-bind="a" x-ng-bind="a">   */  /** @@ -1468,7 +1499,7 @@ function directiveNormalize(name) {   * @name ng.$compile.directive.Attributes#$attr   * @propertyOf ng.$compile.directive.Attributes   * @returns {object} A map of DOM element attribute names to the normalized name. This is - *          needed to do reverse lookup from normalized name back to actual name. + *                   needed to do reverse lookup from normalized name back to actual name.   */ diff --git a/src/ng/controller.js b/src/ng/controller.js index 827d807b..938fbfbe 100644 --- a/src/ng/controller.js +++ b/src/ng/controller.js @@ -27,7 +27,7 @@ function $ControllerProvider() {    this.register = function(name, constructor) {      assertNotHasOwnProperty(name, 'controller');      if (isObject(name)) { -      extend(controllers, name) +      extend(controllers, name);      } else {        controllers[name] = constructor;      } @@ -77,7 +77,9 @@ function $ControllerProvider() {        if (identifier) {          if (!(locals && typeof locals.$scope == 'object')) { -          throw minErr('$controller')('noscp', "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.", constructor || expression.name, identifier); +          throw minErr('$controller')('noscp', +              "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.", +              constructor || expression.name, identifier);          }          locals.$scope[identifier] = instance; diff --git a/src/ng/directive/a.js b/src/ng/directive/a.js index 25cd9105..b3e9ad6d 100644 --- a/src/ng/directive/a.js +++ b/src/ng/directive/a.js @@ -39,6 +39,6 @@ var htmlAnchorDirective = valueFn({            event.preventDefault();          }        }); -    } +    };    }  }); diff --git a/src/ng/directive/directives.js b/src/ng/directive/directives.js index aa316533..b97408e6 100644 --- a/src/ng/directive/directives.js +++ b/src/ng/directive/directives.js @@ -4,7 +4,7 @@ function ngDirective(directive) {    if (isFunction(directive)) {      directive = {        link: directive -    } +    };    }    directive.restrict = directive.restrict || 'AC';    return valueFn(directive); diff --git a/src/ng/directive/form.js b/src/ng/directive/form.js index 455ad15f..6b5c52f4 100644 --- a/src/ng/directive/form.js +++ b/src/ng/directive/form.js @@ -1,6 +1,6 @@  'use strict'; - +/* global -nullFormCtrl */  var nullFormCtrl = {    $addControl: noop,    $removeControl: noop, diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 87afc328..07b5f997 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -1,5 +1,13 @@  'use strict'; +/* global + +    -VALID_CLASS, +    -INVALID_CLASS, +    -PRISTINE_CLASS, +    -DIRTY_CLASS +*/ +  var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;  var EMAIL_REGEXP = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}$/;  var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/; @@ -939,22 +947,22 @@ var VALID_CLASS = 'ng-valid',   * <example module="badIsolatedDirective">      <file name="script.js">  		angular.module('badIsolatedDirective', []).directive('bad', function() { -		  return { -		    require: 'ngModel', -		    scope: { }, -		    template: '<input ng-model="innerModel">', -		    link: function(scope, element, attrs, ngModel) { -		      scope.$watch('innerModel', function(value) { -		        console.log(value); -		        ngModel.$setViewValue(value); -		      }); -		    } -		  }; +      return { +        require: 'ngModel', +        scope: { }, +        template: '<input ng-model="innerModel">', +        link: function(scope, element, attrs, ngModel) { +          scope.$watch('innerModel', function(value) { +            console.log(value); +            ngModel.$setViewValue(value); +          }); +        } +      };  		});      </file>      <file name="index.html"> -	    <input ng-model="someModel"> -	    <div bad ng-model="someModel"></div> +      <input ng-model="someModel"> +      <div bad ng-model="someModel"></div>      </file>   * </example>   * @@ -1047,7 +1055,10 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$     * @param {boolean} isValid Whether the current state is valid (true) or invalid (false).     */    this.$setValidity = function(validationErrorKey, isValid) { +    // Purposeful use of ! here to cast isValid to boolean in case it is undefined +    // jshint -W018      if ($error[validationErrorKey] === !isValid) return; +    // jshint +W018      if (isValid) {        if ($error[validationErrorKey]) invalidCount--; @@ -1127,7 +1138,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$          } catch(e) {            $exceptionHandler(e);          } -      }) +      });      }    }; diff --git a/src/ng/directive/ngBind.js b/src/ng/directive/ngBind.js index c55ab076..82ff505a 100644 --- a/src/ng/directive/ngBind.js +++ b/src/ng/directive/ngBind.js @@ -50,6 +50,9 @@  var ngBindDirective = ngDirective(function(scope, element, attr) {    element.addClass('ng-binding').data('$binding', attr.ngBind);    scope.$watch(attr.ngBind, function ngBindWatchAction(value) { +    // We are purposefully using == here rather than === because we want to +    // catch when value is "null or undefined" +    // jshint -W041      element.text(value == undefined ? '' : value);    });  }); @@ -111,7 +114,7 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {      attr.$observe('ngBindTemplate', function(value) {        element.text(value);      }); -  } +  };  }]; diff --git a/src/ng/directive/ngClass.js b/src/ng/directive/ngClass.js index 7fcdcfec..39568f6a 100644 --- a/src/ng/directive/ngClass.js +++ b/src/ng/directive/ngClass.js @@ -6,7 +6,7 @@ function classDirective(name, selector) {      return {        restrict: 'AC',        link: function(scope, element, attr) { -        var oldVal = undefined; +        var oldVal;          scope.$watch(attr[name], ngClassWatchAction, true); @@ -17,6 +17,7 @@ function classDirective(name, selector) {          if (name !== 'ngClass') {            scope.$watch('$index', function($index, old$index) { +            // jshint bitwise: false              var mod = $index & 1;              if (mod !== old$index & 1) {                if (mod === selector) { @@ -63,7 +64,7 @@ function classDirective(name, selector) {            }            return classVal; -        }; +        }        }      };    }; diff --git a/src/ng/directive/ngIf.js b/src/ng/directive/ngIf.js index dc95d170..00556539 100755..100644 --- a/src/ng/directive/ngIf.js +++ b/src/ng/directive/ngIf.js @@ -104,7 +104,7 @@ var ngIfDirective = ['$animate', function($animate) {              });            }          }); -      } +      };      } -  } +  };  }]; diff --git a/src/ng/directive/ngInit.js b/src/ng/directive/ngInit.js index 854f5c35..36f130c7 100644 --- a/src/ng/directive/ngInit.js +++ b/src/ng/directive/ngInit.js @@ -52,6 +52,6 @@ var ngInitDirective = ngDirective({        pre: function(scope, element, attrs) {          scope.$eval(attrs.ngInit);        } -    } +    };    }  }); diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js index bce76411..e3ff1b8e 100644 --- a/src/ng/directive/ngRepeat.js +++ b/src/ng/directive/ngRepeat.js @@ -243,10 +243,10 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {          } else {            trackByIdArrayFn = function(key, value) {              return hashKey(value); -          } +          };            trackByIdObjFn = function(key) {              return key; -          } +          };          }          match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/); @@ -308,7 +308,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {             trackById = trackByIdFn(key, value, index);             assertNotHasOwnProperty(trackById, '`track by` id');             if(lastBlockMap.hasOwnProperty(trackById)) { -             block = lastBlockMap[trackById] +             block = lastBlockMap[trackById];               delete lastBlockMap[trackById];               nextBlockMap[trackById] = block;               nextBlockOrder[index] = block; @@ -356,9 +356,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {                  nextNode = nextNode.nextSibling;                } while(nextNode && nextNode[NG_REMOVED]); -              if (block.startNode == nextNode) { -                // do nothing -              } else { +              if (block.startNode != nextNode) {                  // existing item which got moved                  $animate.move(getBlockElements(block), null, jqLite(previousNode));                } @@ -374,7 +372,9 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {              childScope.$first = (index === 0);              childScope.$last = (index === (arrayLength - 1));              childScope.$middle = !(childScope.$first || childScope.$last); -            childScope.$odd = !(childScope.$even = index%2==0); +            // jshint bitwise: false +            childScope.$odd = !(childScope.$even = (index&1) === 0); +            // jshint bitwise: true              if (!block.startNode) {                linker(childScope, function(clone) { diff --git a/src/ng/directive/ngSwitch.js b/src/ng/directive/ngSwitch.js index 320400d9..b67aa904 100644 --- a/src/ng/directive/ngSwitch.js +++ b/src/ng/directive/ngSwitch.js @@ -161,7 +161,7 @@ var ngSwitchDirective = ['$animate', function($animate) {          }        });      } -  } +  };  }];  var ngSwitchWhenDirective = ngDirective({ diff --git a/src/ng/directive/select.js b/src/ng/directive/select.js index fb03e0ca..83148e22 100644 --- a/src/ng/directive/select.js +++ b/src/ng/directive/select.js @@ -126,10 +126,12 @@ var ngOptionsMinErr = minErr('ngOptions');   */  var ngOptionsDirective = valueFn({ terminal: true }); +// jshint maxlen: false  var selectDirective = ['$compile', '$parse', function($compile,   $parse) {                           //0000111110000000000022220000000000000000000000333300000000000000444444444444444000000000555555555555555000000066666666666666600000000000000007777000000000000000000088888    var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/,        nullModelCtrl = {$setViewValue: noop}; +// jshint maxlen: 100    return {      restrict: 'E', @@ -210,7 +212,7 @@ var selectDirective = ['$compile', '$parse', function($compile,   $parse) {        // find "null" option        for(var i = 0, children = element.children(), ii = children.length; i < ii; i++) { -        if (children[i].value == '') { +        if (children[i].value === '') {            emptyOption = nullOption = children.eq(i);            break;          } @@ -233,16 +235,16 @@ var selectDirective = ['$compile', '$parse', function($compile,   $parse) {          });        } -      if (optionsExp) Options(scope, element, ngModelCtrl); -      else if (multiple) Multiple(scope, element, ngModelCtrl); -      else Single(scope, element, ngModelCtrl, selectCtrl); +      if (optionsExp) setupAsOptions(scope, element, ngModelCtrl); +      else if (multiple) setupAsMultiple(scope, element, ngModelCtrl); +      else setupAsSingle(scope, element, ngModelCtrl, selectCtrl);        //////////////////////////// -      function Single(scope, selectElement, ngModelCtrl, selectCtrl) { +      function setupAsSingle(scope, selectElement, ngModelCtrl, selectCtrl) {          ngModelCtrl.$render = function() {            var viewValue = ngModelCtrl.$viewValue; @@ -267,7 +269,7 @@ var selectDirective = ['$compile', '$parse', function($compile,   $parse) {          });        } -      function Multiple(scope, selectElement, ctrl) { +      function setupAsMultiple(scope, selectElement, ctrl) {          var lastView;          ctrl.$render = function() {            var items = new HashMap(ctrl.$viewValue); @@ -298,12 +300,14 @@ var selectDirective = ['$compile', '$parse', function($compile,   $parse) {          });        } -      function Options(scope, selectElement, ctrl) { +      function setupAsOptions(scope, selectElement, ctrl) {          var match;          if (! (match = optionsExp.match(NG_OPTIONS_REGEXP))) {            throw ngOptionsMinErr('iexp', -            "Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}", +            "Expected expression in form of " + +            "'_select_ (as _label_)? for (_key_,)?_value_ in _collection_'" + +            " but got '{0}'. Element: {1}",              optionsExp, startingTag(selectElement));          } @@ -315,9 +319,10 @@ var selectDirective = ['$compile', '$parse', function($compile,   $parse) {              valuesFn = $parse(match[7]),              track = match[8],              trackFn = track ? $parse(match[8]) : null, -            // This is an array of array of existing option groups in DOM. We try to reuse these if possible -            // optionGroupsCache[0] is the options with no option group -            // optionGroupsCache[?][0] is the parent: either the SELECT or OPTGROUP element +            // This is an array of array of existing option groups in DOM. +            // We try to reuse these if possible +            // - optionGroupsCache[0] is the options with no option group +            // - optionGroupsCache[?][0] is the parent: either the SELECT or OPTGROUP element              optionGroupsCache = [[{element: selectElement, label:''}]];          if (nullOption) { @@ -371,7 +376,7 @@ var selectDirective = ['$compile', '$parse', function($compile,   $parse) {                key = selectElement.val();                if (key == '?') {                  value = undefined; -              } else if (key == ''){ +              } else if (key === ''){                  value = null;                } else {                  if (trackFn) { @@ -399,7 +404,8 @@ var selectDirective = ['$compile', '$parse', function($compile,   $parse) {          scope.$watch(render);          function render() { -          var optionGroups = {'':[]}, // Temporary location for the option groups before we render them +              // Temporary location for the option groups before we render them +          var optionGroups = {'':[]},                optionGroupNames = [''],                optionGroupName,                optionGroup, @@ -448,7 +454,9 @@ var selectDirective = ['$compile', '$parse', function($compile,   $parse) {                optionGroupNames.push(optionGroupName);              }              if (multiple) { -              selected = selectedSet.remove(trackFn ? trackFn(scope, locals) : valueFn(scope, locals)) !== undefined; +              selected = isDefined( +                selectedSet.remove(trackFn ? trackFn(scope, locals) : valueFn(scope, locals)) +              );              } else {                if (trackFn) {                  var modelCast = {}; @@ -460,9 +468,12 @@ var selectDirective = ['$compile', '$parse', function($compile,   $parse) {                selectedSet = selectedSet || selected; // see if at least one item is selected              }              label = displayFn(scope, locals); // what will be seen by the user -            label = label === undefined ? '' : label; // doing displayFn(scope, locals) || '' overwrites zero values + +            // doing displayFn(scope, locals) || '' overwrites zero values +            label = isDefined(label) ? label : '';              optionGroup.push({ -              id: trackFn ? trackFn(scope, locals) : (keyName ? keys[index] : index),   // either the index into array or key from object +              // either the index into array or key from object +              id: trackFn ? trackFn(scope, locals) : (keyName ? keys[index] : index),                label: label,                selected: selected                   // determine if we should be selected              }); diff --git a/src/ng/filter.js b/src/ng/filter.js index f41efbd9..11607abc 100644 --- a/src/ng/filter.js +++ b/src/ng/filter.js @@ -5,9 +5,9 @@   * @name ng.$filterProvider   * @description   * - * Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To - * achieve this a filter definition consists of a factory function which is annotated with dependencies and is - * responsible for creating a filter function. + * Filters are just functions which transform input to an output. However filters need to be + * Dependency Injected. To achieve this a filter definition consists of a factory function which is + * annotated with dependencies and is responsible for creating a filter function.   *   * <pre>   *   // Filter registration @@ -30,7 +30,9 @@   *   }   * </pre>   * - * The filter function is registered with the `$injector` under the filter name suffix with `Filter`. + * The filter function is registered with the `$injector` under the filter name suffix with + * `Filter`. + *    * <pre>   *   it('should be the same instance', inject(   *     function($filterProvider) { @@ -107,6 +109,18 @@ function $FilterProvider($provide) {    }];    //////////////////////////////////////// +   +  /* global +    currencyFilter: false, +    dateFilter: false, +    filterFilter: false, +    jsonFilter: false, +    limitToFilter: false, +    lowercaseFilter: false, +    numberFilter: false, +    orderByFilter: false, +    uppercaseFilter: false, +  */    register('currency', currencyFilter);    register('date', dateFilter); diff --git a/src/ng/filter/filter.js b/src/ng/filter/filter.js index b55e11f4..24c0e444 100644 --- a/src/ng/filter/filter.js +++ b/src/ng/filter/filter.js @@ -105,9 +105,12 @@     </doc:example>   */  function filterFilter() { -  return function(array, expression, comperator) { +  return function(array, expression, comparator) {      if (!isArray(array)) return array; -    var predicates = []; + +    var comparatorType = typeof(comparator), +        predicates = []; +      predicates.check = function(value) {        for (var j = 0; j < predicates.length; j++) {          if(!predicates[j](value)) { @@ -116,22 +119,20 @@ function filterFilter() {        }        return true;      }; -    switch(typeof comperator) { -      case "function": -        break; -      case "boolean": -        if(comperator == true) { -          comperator = function(obj, text) { -            return angular.equals(obj, text); -          } -          break; -        } -      default: -        comperator = function(obj, text) { + +    if (comparatorType !== 'function') { +      if (comparatorType === 'boolean' && comparator) { +        comparator = function(obj, text) { +          return angular.equals(obj, text); +        }; +      } else { +        comparator = function(obj, text) {            text = (''+text).toLowerCase();            return (''+obj).toLowerCase().indexOf(text) > -1;          }; +      }      } +      var search = function(obj, text){        if (typeof text == 'string' && text.charAt(0) === '!') {          return !search(obj, text.substr(1)); @@ -140,12 +141,11 @@ function filterFilter() {          case "boolean":          case "number":          case "string": -          return comperator(obj, text); +          return comparator(obj, text);          case "object":            switch (typeof text) {              case "object": -              return comperator(obj, text); -              break; +              return comparator(obj, text);              default:                for ( var objKey in obj) {                  if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) { @@ -170,13 +170,16 @@ function filterFilter() {        case "boolean":        case "number":        case "string": +        // Set up expression object and fall through          expression = {$:expression}; +        // jshint -W086        case "object": +        // jshint +W086          for (var key in expression) {            if (key == '$') {              (function() {                if (!expression[key]) return; -              var path = key +              var path = key;                predicates.push(function(value) {                  return search(value, expression[path]);                }); @@ -206,5 +209,5 @@ function filterFilter() {        }      }      return filtered; -  } +  };  } diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js index d387f668..c92ed384 100644 --- a/src/ng/filter/filters.js +++ b/src/ng/filter/filters.js @@ -144,13 +144,13 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {      var whole = fraction[0];      fraction = fraction[1] || ''; -    var pos = 0, +    var i, pos = 0,          lgroup = pattern.lgSize,          group = pattern.gSize;      if (whole.length >= (lgroup + group)) {        pos = whole.length - lgroup; -      for (var i = 0; i < pos; i++) { +      for (i = 0; i < pos; i++) {          if ((pos - i)%group === 0 && i !== 0) {            formatedText += groupSep;          } @@ -364,7 +364,7 @@ function dateFilter($locale) {        }        dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3]));        var h = int(match[4]||0) - tzHour; -      var m = int(match[5]||0) - tzMin +      var m = int(match[5]||0) - tzMin;        var s = int(match[6]||0);        var ms = Math.round(parseFloat('0.' + (match[7]||0)) * 1000);        timeSetter.call(date, h, m, s, ms); diff --git a/src/ng/filter/limitTo.js b/src/ng/filter/limitTo.js index bbbeb83c..3c88e470 100644 --- a/src/ng/filter/limitTo.js +++ b/src/ng/filter/limitTo.js @@ -100,5 +100,5 @@ function limitToFilter(){      }      return out; -  } +  };  } diff --git a/src/ng/filter/orderBy.js b/src/ng/filter/orderBy.js index 65fbdde0..7ef41c8b 100644 --- a/src/ng/filter/orderBy.js +++ b/src/ng/filter/orderBy.js @@ -135,5 +135,5 @@ function orderByFilter($parse){          return t1 < t2 ? -1 : 1;        }      } -  } +  };  } diff --git a/src/ng/http.js b/src/ng/http.js index a09691e7..814694cd 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -224,11 +224,11 @@ function $HttpProvider() {       * called for such responses.       *        * # Calling $http from outside AngularJS -     * The `$http` service will not actually send the request until the next `$digest()` is executed. -     * Normally this is not an issue, since almost all the time your call to `$http` will be from within -     * a `$apply()` block. -     * If you are calling `$http` from outside Angular, then you should wrap it in a call to `$apply` -     * to cause a $digest to occur and also to handle errors in the block correctly. +     * The `$http` service will not actually send the request until the next `$digest()` is +     * executed. Normally this is not an issue, since almost all the time your call to `$http` will +     * be from within a `$apply()` block. +     * If you are calling `$http` from outside Angular, then you should wrap it in a call to +     * `$apply` to cause a $digest to occur and also to handle errors in the block correctly.       *       * ```       * $scope.$apply(function() { @@ -237,10 +237,11 @@ function $HttpProvider() {       * ```       *       * # Writing Unit Tests that use $http -     * When unit testing you are mostly responsible for scheduling the `$digest` cycle. If you do not -     * trigger a `$digest` before calling `$httpBackend.flush()` then the request will not have been -     * made and `$httpBackend.expect(...)` expectations will fail.  The solution is to run the code -     * that calls the `$http()` method inside a $apply block as explained in the previous section. +     * When unit testing you are mostly responsible for scheduling the `$digest` cycle. If you do +     * not trigger a `$digest` before calling `$httpBackend.flush()` then the request will not have +     * been made and `$httpBackend.expect(...)` expectations will fail.  The solution is to run the +     * code that calls the `$http()` method inside a $apply block as explained in the previous +     * section.       *       * ```       * $httpBackend.expectGET(...); @@ -300,22 +301,24 @@ function $HttpProvider() {       *       * Request transformations:       * -     * - If the `data` property of the request configuration object contains an object, serialize it into -     *   JSON format. +     * - If the `data` property of the request configuration object contains an object, serialize it +     *   into JSON format.       *       * Response transformations:       *       *  - If XSRF prefix is detected, strip it (see Security Considerations section below).       *  - If JSON response is detected, deserialize it using a JSON parser.       * -     * To globally augment or override the default transforms, modify the `$httpProvider.defaults.transformRequest` and -     * `$httpProvider.defaults.transformResponse` properties. These properties are by default an -     * array of transform functions, which allows you to `push` or `unshift` a new transformation function into the -     * transformation chain. You can also decide to completely override any default transformations by assigning your +     * To globally augment or override the default transforms, modify the +     * `$httpProvider.defaults.transformRequest` and `$httpProvider.defaults.transformResponse` +     * properties. These properties are by default an array of transform functions, which allows you +     * to `push` or `unshift` a new transformation function into the transformation chain. You can +     * also decide to completely override any default transformations by assigning your       * transformation functions to these properties directly without the array wrapper.       * -     * Similarly, to locally override the request/response transforms, augment the `transformRequest` and/or -     * `transformResponse` properties of the configuration object passed into `$http`. +     * Similarly, to locally override the request/response transforms, augment the +     * `transformRequest` and/or `transformResponse` properties of the configuration object passed +     * into `$http`.       *       *       * # Caching @@ -353,16 +356,16 @@ function $HttpProvider() {       *       * There are two kinds of interceptors (and two kinds of rejection interceptors):       * -     *   * `request`: interceptors get called with http `config` object. The function is free to modify -     *     the `config` or create a new one. The function needs to return the `config` directly or as a -     *     promise. -     *   * `requestError`: interceptor gets called when a previous interceptor threw an error or resolved -     *      with a rejection. -     *   * `response`: interceptors get called with http `response` object. The function is free to modify -     *     the `response` or create a new one. The function needs to return the `response` directly or as a -     *     promise. -     *   * `responseError`: interceptor gets called when a previous interceptor threw an error or resolved -     *      with a rejection. +     *   * `request`: interceptors get called with http `config` object. The function is free to +     *     modify the `config` or create a new one. The function needs to return the `config` +     *     directly or as a promise. +     *   * `requestError`: interceptor gets called when a previous interceptor threw an error or +     *     resolved with a rejection. +     *   * `response`: interceptors get called with http `response` object. The function is free to +     *     modify the `response` or create a new one. The function needs to return the `response` +     *     directly or as a promise. +     *   * `responseError`: interceptor gets called when a previous interceptor threw an error or +     *     resolved with a rejection.       *       *       * <pre> @@ -511,9 +514,10 @@ function $HttpProvider() {       * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the       * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure       * that only JavaScript running on your domain could have sent the request. The token must be -     * unique for each user and must be verifiable by the server (to prevent the JavaScript from making -     * up its own tokens). We recommend that the token is a digest of your site's authentication -     * cookie with a {@link https://en.wikipedia.org/wiki/Salt_(cryptography) salt} for added security. +     * unique for each user and must be verifiable by the server (to prevent the JavaScript from +     * making up its own tokens). We recommend that the token is a digest of your site's +     * authentication cookie with a {@link https://en.wikipedia.org/wiki/Salt_(cryptography) salt} +     * for added security.       *       * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName       * properties of either $httpProvider.defaults, or the per-request config object. @@ -524,18 +528,21 @@ function $HttpProvider() {       *       *    - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)       *    - **url** – `{string}` – Absolute or relative URL of the resource that is being requested. -     *    - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be turned to -     *      `?key1=value1&key2=value2` after the url. If the value is not a string, it will be JSONified. +     *    - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be turned +     *      to `?key1=value1&key2=value2` after the url. If the value is not a string, it will be +     *      JSONified.       *    - **data** – `{string|Object}` – Data to be sent as the request message data.       *    - **headers** – `{Object}` – Map of strings or functions which return strings representing -     *      HTTP headers to send to the server. If the return value of a function is null, the header will -     *      not be sent. +     *      HTTP headers to send to the server. If the return value of a function is null, the +     *      header will not be sent.       *    - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.       *    - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token. -     *    - **transformRequest** – `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` – +     *    - **transformRequest** – +     *      `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –       *      transform function or an array of such functions. The transform function takes the http       *      request body and headers and returns its transformed (typically serialized) version. -     *    - **transformResponse** – `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` – +     *    - **transformResponse** – +     *      `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –       *      transform function or an array of such functions. The transform function takes the http       *      response body and headers and returns its transformed (typically deserialized) version.       *    - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the @@ -558,7 +565,8 @@ function $HttpProvider() {       *   these functions are destructured representation of the response object passed into the       *   `then` method. The response object has these properties:       * -     *   - **data** – `{string|Object}` – The response body transformed with the transform functions. +     *   - **data** – `{string|Object}` – The response body transformed with the transform +     *     functions.       *   - **status** – `{number}` – HTTP status code of the response.       *   - **headers** – `{function([headerName])}` – Header getter function.       *   - **config** – `{Object}` – The configuration object that was used to generate the request. @@ -568,75 +576,82 @@ function $HttpProvider() {       *       *       * @example -      <example> -        <file name="index.html"> -          <div ng-controller="FetchCtrl"> -            <select ng-model="method"> -              <option>GET</option> -              <option>JSONP</option> -            </select> -            <input type="text" ng-model="url" size="80"/> -            <button ng-click="fetch()">fetch</button><br> -            <button ng-click="updateModel('GET', 'http-hello.html')">Sample GET</button> -            <button ng-click="updateModel('JSONP', 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')">Sample JSONP</button> -            <button ng-click="updateModel('JSONP', 'http://angularjs.org/doesntexist&callback=JSON_CALLBACK')">Invalid JSONP</button> -            <pre>http status code: {{status}}</pre> -            <pre>http response data: {{data}}</pre> -          </div> -        </file> -        <file name="script.js"> -          function FetchCtrl($scope, $http, $templateCache) { -            $scope.method = 'GET'; -            $scope.url = 'http-hello.html'; - -            $scope.fetch = function() { -              $scope.code = null; -              $scope.response = null; - -              $http({method: $scope.method, url: $scope.url, cache: $templateCache}). -                success(function(data, status) { -                  $scope.status = status; -                  $scope.data = data; -                }). -                error(function(data, status) { -                  $scope.data = data || "Request failed"; -                  $scope.status = status; -              }); -            }; - -            $scope.updateModel = function(method, url) { -              $scope.method = method; -              $scope.url = url; -            }; -          } -        </file> -        <file name="http-hello.html"> -          Hello, $http! -        </file> -        <file name="scenario.js"> -          it('should make an xhr GET request', function() { -            element(':button:contains("Sample GET")').click(); -            element(':button:contains("fetch")').click(); -            expect(binding('status')).toBe('200'); -            expect(binding('data')).toMatch(/Hello, \$http!/); -          }); +<example> +<file name="index.html"> +  <div ng-controller="FetchCtrl"> +    <select ng-model="method"> +      <option>GET</option> +      <option>JSONP</option> +    </select> +    <input type="text" ng-model="url" size="80"/> +    <button ng-click="fetch()">fetch</button><br> +    <button ng-click="updateModel('GET', 'http-hello.html')">Sample GET</button> +    <button +      ng-click="updateModel('JSONP', +                    'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')"> +      Sample JSONP +    </button> +    <button +      ng-click="updateModel('JSONP', 'http://angularjs.org/doesntexist&callback=JSON_CALLBACK')"> +        Invalid JSONP +      </button> +    <pre>http status code: {{status}}</pre> +    <pre>http response data: {{data}}</pre> +  </div> +</file> +<file name="script.js"> +  function FetchCtrl($scope, $http, $templateCache) { +    $scope.method = 'GET'; +    $scope.url = 'http-hello.html'; + +    $scope.fetch = function() { +      $scope.code = null; +      $scope.response = null; + +      $http({method: $scope.method, url: $scope.url, cache: $templateCache}). +        success(function(data, status) { +          $scope.status = status; +          $scope.data = data; +        }). +        error(function(data, status) { +          $scope.data = data || "Request failed"; +          $scope.status = status; +      }); +    }; + +    $scope.updateModel = function(method, url) { +      $scope.method = method; +      $scope.url = url; +    }; +  } +</file> +<file name="http-hello.html"> +  Hello, $http! +</file> +<file name="scenario.js"> +  it('should make an xhr GET request', function() { +    element(':button:contains("Sample GET")').click(); +    element(':button:contains("fetch")').click(); +    expect(binding('status')).toBe('200'); +    expect(binding('data')).toMatch(/Hello, \$http!/); +  }); -          it('should make a JSONP request to angularjs.org', function() { -            element(':button:contains("Sample JSONP")').click(); -            element(':button:contains("fetch")').click(); -            expect(binding('status')).toBe('200'); -            expect(binding('data')).toMatch(/Super Hero!/); -          }); +  it('should make a JSONP request to angularjs.org', function() { +    element(':button:contains("Sample JSONP")').click(); +    element(':button:contains("fetch")').click(); +    expect(binding('status')).toBe('200'); +    expect(binding('data')).toMatch(/Super Hero!/); +  }); -          it('should make JSONP request to invalid URL and invoke the error handler', -              function() { -            element(':button:contains("Invalid JSONP")').click(); -            element(':button:contains("fetch")').click(); -            expect(binding('status')).toBe('0'); -            expect(binding('data')).toBe('Request failed'); -          }); -        </file> -      </example> +  it('should make JSONP request to invalid URL and invoke the error handler', +      function() { +    element(':button:contains("Invalid JSONP")').click(); +    element(':button:contains("fetch")').click(); +    expect(binding('status')).toBe('0'); +    expect(binding('data')).toBe('Request failed'); +  }); +</file> +</example>       */      function $http(requestConfig) {        var config = { @@ -996,7 +1011,7 @@ function $HttpProvider() {            if (!params) return url;            var parts = [];            forEachSorted(params, function(value, key) { -            if (value == null || value == undefined) return; +            if (value === null || isUndefined(value)) return;              if (!isArray(value)) value = [value];              forEach(value, function(v) { diff --git a/src/ng/httpBackend.js b/src/ng/httpBackend.js index 55ea5607..dcb15f77 100644 --- a/src/ng/httpBackend.js +++ b/src/ng/httpBackend.js @@ -1,4 +1,7 @@ +'use strict'; +  var XHR = window.XMLHttpRequest || function() { +  /* global ActiveXObject */    try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {}    try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {}    try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {} @@ -69,7 +72,7 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,            var responseHeaders = xhr.getAllResponseHeaders();            // responseText is the old-school way of retrieving response (supported by IE8 & 9) -          // response and responseType properties were introduced in XHR Level2 spec (supported by IE10) +          // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)            completeRequest(callback,                status || xhr.status,                (xhr.responseType ? xhr.response : xhr.responseText), diff --git a/src/ng/interpolate.js b/src/ng/interpolate.js index d02a6a07..43593f91 100644 --- a/src/ng/interpolate.js +++ b/src/ng/interpolate.js @@ -12,31 +12,31 @@ var $interpolateMinErr = minErr('$interpolate');   * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.   *   * @example -   <doc:example module="customInterpolationApp"> -     <doc:source> -      <script> -        var customInterpolationApp = angular.module('customInterpolationApp', []); - -        customInterpolationApp.config(function($interpolateProvider) { -          $interpolateProvider.startSymbol('//'); -          $interpolateProvider.endSymbol('//'); -        }); - - -        customInterpolationApp.controller('DemoController', function DemoController() { -            this.label = "This bindings is brought you you by // interpolation symbols."; -        }); -      </script> -      <div ng-app="App" ng-controller="DemoController as demo"> -          //demo.label// -      </div> -     </doc:source> -     <doc:scenario> -       it('should interpolate binding with custom symbols', function() { -         expect(binding('demo.label')).toBe('This bindings is brought you you by // interpolation symbols.'); -       }); - </doc:scenario> -   </doc:example> +<doc:example module="customInterpolationApp"> +<doc:source> +<script> +  var customInterpolationApp = angular.module('customInterpolationApp', []); + +  customInterpolationApp.config(function($interpolateProvider) { +    $interpolateProvider.startSymbol('//'); +    $interpolateProvider.endSymbol('//'); +  }); + + +  customInterpolationApp.controller('DemoController', function DemoController() { +      this.label = "This binding is brought you by // interpolation symbols."; +  }); +</script> +<div ng-app="App" ng-controller="DemoController as demo"> +    //demo.label// +</div> +</doc:source> +<doc:scenario> + it('should interpolate binding with custom symbols', function() { +  expect(binding('demo.label')).toBe('This binding is brought you by // interpolation symbols.'); + }); +</doc:scenario> +</doc:example>   */  function $InterpolateProvider() {    var startSymbol = '{{'; @@ -116,8 +116,8 @@ function $InterpolateProvider() {       *    result through {@link ng.$sce#methods_getTrusted $sce.getTrusted(interpolatedResult,       *    trustedContext)} before returning it.  Refer to the {@link ng.$sce $sce} service that       *    provides Strict Contextual Escaping for details. -     * @returns {function(context)} an interpolation function which is used to compute the interpolated -     *    string. The function has these parameters: +     * @returns {function(context)} an interpolation function which is used to compute the +     *    interpolated string. The function has these parameters:       *       *    * `context`: an object against which any expressions embedded in the strings are evaluated       *      against. @@ -155,12 +155,12 @@ function $InterpolateProvider() {          length = 1;        } -      // Concatenating expressions makes it hard to reason about whether some combination of concatenated -      // values are unsafe to use and could easily lead to XSS.  By requiring that a single -      // expression be used for iframe[src], object[src], etc., we ensure that the value that's used -      // is assigned or constructed by some JS code somewhere that is more testable or make it -      // obvious that you bound the value to some user controlled value.  This helps reduce the load -      // when auditing for XSS issues. +      // Concatenating expressions makes it hard to reason about whether some combination of +      // concatenated values are unsafe to use and could easily lead to XSS.  By requiring that a +      // single expression be used for iframe[src], object[src], etc., we ensure that the value +      // that's used is assigned or constructed by some JS code somewhere that is more testable or +      // make it obvious that you bound the value to some user controlled value.  This helps reduce +      // the load when auditing for XSS issues.        if (trustedContext && parts.length > 1) {            throw $interpolateMinErr('noconcat',                "Error while interpolating: {0}\nStrict Contextual Escaping disallows " + @@ -180,7 +180,7 @@ function $InterpolateProvider() {                  } else {                    part = $sce.valueOf(part);                  } -                if (part == null || part == undefined) { +                if (part === null || isUndefined(part)) {                    part = '';                  } else if (typeof part != 'string') {                    part = toJson(part); @@ -191,7 +191,8 @@ function $InterpolateProvider() {              return concat.join('');            }            catch(err) { -            var newErr = $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, err.toString()); +            var newErr = $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, +                err.toString());              $exceptionHandler(newErr);            }          }; @@ -216,7 +217,7 @@ function $InterpolateProvider() {       */      $interpolate.startSymbol = function() {        return startSymbol; -    } +    };      /** @@ -233,7 +234,7 @@ function $InterpolateProvider() {       */      $interpolate.endSymbol = function() {        return endSymbol; -    } +    };      return $interpolate;    }]; diff --git a/src/ng/interval.js b/src/ng/interval.js index 04493b11..2ad3a7f1 100644 --- a/src/ng/interval.js +++ b/src/ng/interval.js @@ -35,13 +35,13 @@ function $IntervalProvider() {        */      function interval(fn, delay, count, invokeApply) {        var setInterval = $window.setInterval, -          clearInterval = $window.clearInterval; - -      var deferred = $q.defer(), +          clearInterval = $window.clearInterval, +          deferred = $q.defer(),            promise = deferred.promise, -          count = (isDefined(count)) ? count : 0,            iteration = 0,            skipApply = (isDefined(invokeApply) && !invokeApply); +       +      count = isDefined(count) ? count : 0,        promise.then(null, null, fn); diff --git a/src/ng/locale.js b/src/ng/locale.js index 06d2dd07..23df4275 100644 --- a/src/ng/locale.js +++ b/src/ng/locale.js @@ -45,8 +45,9 @@ function $LocaleProvider(){        },        DATETIME_FORMATS: { -        MONTH: 'January,February,March,April,May,June,July,August,September,October,November,December' -                .split(','), +        MONTH: +            'January,February,March,April,May,June,July,August,September,October,November,December' +            .split(','),          SHORTMONTH:  'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),          DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),          SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','), diff --git a/src/ng/location.js b/src/ng/location.js index 5268bc04..abb6135a 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -37,12 +37,15 @@ function parseAppUrl(relativeUrl, locationObj) {      relativeUrl = '/' + relativeUrl;    }    var match = urlResolve(relativeUrl); -  locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ? match.pathname.substring(1) : match.pathname); +  locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ? +      match.pathname.substring(1) : match.pathname);    locationObj.$$search = parseKeyValue(match.search);    locationObj.$$hash = decodeURIComponent(match.hash);    // make sure path starts with '/'; -  if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') locationObj.$$path = '/' + locationObj.$$path; +  if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') { +    locationObj.$$path = '/' + locationObj.$$path; +  }  } @@ -50,10 +53,11 @@ function parseAppUrl(relativeUrl, locationObj) {   *   * @param {string} begin   * @param {string} whole - * @returns {string} returns text from whole after begin or undefined if it does not begin with expected string. + * @returns {string} returns text from whole after begin or undefined if it does not begin with + *                   expected string.   */  function beginsWith(begin, whole) { -  if (whole.indexOf(begin) == 0) { +  if (whole.indexOf(begin) === 0) {      return whole.substr(begin.length);    }  } @@ -98,7 +102,8 @@ function LocationHtml5Url(appBase, basePrefix) {    this.$$parse = function(url) {      var pathUrl = beginsWith(appBaseNoFile, url);      if (!isString(pathUrl)) { -      throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url, appBaseNoFile); +      throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url, +          appBaseNoFile);      }      parseAppUrl(pathUrl, this); @@ -137,7 +142,7 @@ function LocationHtml5Url(appBase, basePrefix) {      } else if (appBaseNoFile == url + '/') {        return appBaseNoFile;      } -  } +  };  } @@ -170,7 +175,8 @@ function LocationHashbangUrl(appBase, hashPrefix) {            : '';      if (!isString(withoutHashUrl)) { -      throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url, hashPrefix); +      throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url, +          hashPrefix);      }      parseAppUrl(withoutHashUrl, this);      this.$$compose(); @@ -192,7 +198,7 @@ function LocationHashbangUrl(appBase, hashPrefix) {      if(stripHash(appBase) == stripHash(url)) {        return url;      } -  } +  };  } @@ -221,7 +227,7 @@ function LocationHashbangInHtml5Url(appBase, hashPrefix) {      } else if ( appBaseNoFile === url + '/') {        return appBaseNoFile;      } -  } +  };  } @@ -360,10 +366,12 @@ LocationHashbangInHtml5Url.prototype =     *     * Change search part when called with parameter and return `$location`.     * -   * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or hash object. Hash object -   *    may contain an array of values, which will be decoded as duplicates in the url. +   * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or +   * hash object. Hash object may contain an array of values, which will be decoded as duplicates in +   * the url. +   *      * @param {string=} paramValue If `search` is a string, then `paramValue` will override only a -   *    single search parameter. If the value is `null`, the parameter will be deleted. +   * single search parameter. If the value is `null`, the parameter will be deleted.     *     * @return {string} search     */ @@ -377,11 +385,12 @@ LocationHashbangInHtml5Url.prototype =          } else if (isObject(search)) {            this.$$search = search;          } else { -          throw $locationMinErr('isrcharg', 'The first argument of the `$location#search()` call must be a string or an object.'); +          throw $locationMinErr('isrcharg', +              'The first argument of the `$location#search()` call must be a string or an object.');          }          break;        default: -        if (paramValue == undefined || paramValue == null) { +        if (isUndefined(paramValue) || paramValue === null) {            delete this.$$search[search];          } else {            this.$$search[search] = paramValue; @@ -573,7 +582,8 @@ function $LocationProvider(){      // update $location when $browser url changes      $browser.onUrlChange(function(newUrl) {        if ($location.absUrl() != newUrl) { -        if ($rootScope.$broadcast('$locationChangeStart', newUrl, $location.absUrl()).defaultPrevented) { +        if ($rootScope.$broadcast('$locationChangeStart', newUrl, +                                  $location.absUrl()).defaultPrevented) {            $browser.url($location.absUrl());            return;          } diff --git a/src/ng/log.js b/src/ng/log.js index 70911fdf..cedf0264 100644 --- a/src/ng/log.js +++ b/src/ng/log.js @@ -55,12 +55,12 @@ function $LogProvider(){     * @returns {*} current value if used as getter or itself (chaining) if used as setter     */    this.debugEnabled = function(flag) { -	  if (isDefined(flag)) { -		  debug = flag; -		  return this; -	  } else { -		  return debug; -	  } +    if (isDefined(flag)) { +      debug = flag; +    return this; +    } else { +      return debug; +    }    };    this.$get = ['$window', function($window){ @@ -114,13 +114,13 @@ function $LogProvider(){         * Write a debug message         */        debug: (function () { -    	var fn = consoleLog('debug'); -    	 -    	return function() { -    		if (debug) { -    			fn.apply(self, arguments); -    		} -    	} +        var fn = consoleLog('debug'); + +        return function() { +          if (debug) { +            fn.apply(self, arguments); +          } +        };        }())      }; @@ -155,7 +155,7 @@ function $LogProvider(){        // or we are IE where console.log doesn't have apply so we log at least first 2 args        return function(arg1, arg2) {          logFn(arg1, arg2 == null ? '' : arg2); -      } +      };      }    }];  } diff --git a/src/ng/parse.js b/src/ng/parse.js index f6c85358..c93d07de 100644 --- a/src/ng/parse.js +++ b/src/ng/parse.js @@ -6,58 +6,65 @@ var promiseWarning;  // Sandboxing Angular Expressions  // ------------------------------ -// Angular expressions are generally considered safe because these expressions only have direct access to $scope and -// locals. However, one can obtain the ability to execute arbitrary JS code by obtaining a reference to native JS -// functions such as the Function constructor. +// Angular expressions are generally considered safe because these expressions only have direct +// access to $scope and locals. However, one can obtain the ability to execute arbitrary JS code by +// obtaining a reference to native JS functions such as the Function constructor.  //  // As an example, consider the following Angular expression:  //  //   {}.toString.constructor(alert("evil JS code"))  // -// We want to prevent this type of access. For the sake of performance, during the lexing phase we disallow any "dotted" -// access to any member named "constructor". +// We want to prevent this type of access. For the sake of performance, during the lexing phase we +// disallow any "dotted" access to any member named "constructor".  // -// For reflective calls (a[b]) we check that the value of the lookup is not the Function constructor while evaluating -// the expression, which is a stronger but more expensive test. Since reflective calls are expensive anyway, this is not -// such a big deal compared to static dereferencing. +// For reflective calls (a[b]) we check that the value of the lookup is not the Function constructor +// while evaluating the expression, which is a stronger but more expensive test. Since reflective +// calls are expensive anyway, this is not such a big deal compared to static dereferencing.  // -// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits against the -// expression language, but not to prevent exploits that were enabled by exposing sensitive JavaScript or browser apis -// on Scope. Exposing such objects on a Scope is never a good practice and therefore we are not even trying to protect -// against interaction with an object explicitly exposed in this way. +// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits +// against the expression language, but not to prevent exploits that were enabled by exposing +// sensitive JavaScript or browser apis on Scope. Exposing such objects on a Scope is never a good +// practice and therefore we are not even trying to protect against interaction with an object +// explicitly exposed in this way.  // -// A developer could foil the name check by aliasing the Function constructor under a different name on the scope. +// A developer could foil the name check by aliasing the Function constructor under a different +// name on the scope.  // -// In general, it is not possible to access a Window object from an angular expression unless a window or some DOM -// object that has a reference to window is published onto a Scope. +// In general, it is not possible to access a Window object from an angular expression unless a +// window or some DOM object that has a reference to window is published onto a Scope.  function ensureSafeMemberName(name, fullExpression) {    if (name === "constructor") {      throw $parseMinErr('isecfld', -        'Referencing "constructor" field in Angular expressions is disallowed! Expression: {0}', fullExpression); +        'Referencing "constructor" field in Angular expressions is disallowed! Expression: {0}', +        fullExpression);    }    return name; -}; +}  function ensureSafeObject(obj, fullExpression) {    // nifty check if obj is Function that is fast and works across iframes and other contexts    if (obj && obj.constructor === obj) {      throw $parseMinErr('isecfn', -        'Referencing Function in Angular expressions is disallowed! Expression: {0}', fullExpression); +        'Referencing Function in Angular expressions is disallowed! Expression: {0}', +        fullExpression);    } else if (// isWindow(obj)        obj && obj.document && obj.location && obj.alert && obj.setInterval) {      throw $parseMinErr('isecwindow', -        'Referencing the Window in Angular expressions is disallowed! Expression: {0}', fullExpression); +        'Referencing the Window in Angular expressions is disallowed! Expression: {0}', +        fullExpression);    } else if (// isElement(obj)        obj && (obj.nodeName || (obj.on && obj.find))) {      throw $parseMinErr('isecdom', -        'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}', fullExpression); +        'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}', +        fullExpression);    } else {      return obj;    }  }  var OPERATORS = { +    /* jshint bitwise : false */      'null':function(){return null;},      'true':function(){return true;},      'false':function(){return false;}, @@ -71,7 +78,10 @@ var OPERATORS = {          return a;        }        return isDefined(b)?b:undefined;}, -    '-':function(self, locals, a,b){a=a(self, locals); b=b(self, locals); return (isDefined(a)?a:0)-(isDefined(b)?b:0);}, +    '-':function(self, locals, a,b){ +          a=a(self, locals); b=b(self, locals); +          return (isDefined(a)?a:0)-(isDefined(b)?b:0); +        },      '*':function(self, locals, a,b){return a(self, locals)*b(self, locals);},      '/':function(self, locals, a,b){return a(self, locals)/b(self, locals);},      '%':function(self, locals, a,b){return a(self, locals)%b(self, locals);}, @@ -92,6 +102,7 @@ var OPERATORS = {      '|':function(self, locals, a,b){return b(self, locals)(self, locals, a(self, locals));},      '!':function(self, locals, a){return !a(self, locals);}  }; +/* jshint bitwise: true */  var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'}; @@ -192,8 +203,9 @@ Lexer.prototype = {    },    isWhitespace: function(ch) { +    // IE treats non-breaking space as \u00A0      return (ch === ' ' || ch === '\r' || ch === '\t' || -            ch === '\n' || ch === '\v' || ch === '\u00A0'); // IE treats non-breaking space as \u00A0 +            ch === '\n' || ch === '\v' || ch === '\u00A0');    },    isIdent: function(ch) { @@ -960,7 +972,7 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {              pathVal = pathVal.$$v;            }            return pathVal; -        } +        };  }  function getterFn(path, options, fullExp) { @@ -976,20 +988,22 @@ function getterFn(path, options, fullExp) {        fn;    if (options.csp) { -    fn = (pathKeysLength < 6) -        ? cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4], fullExp, options) -        : function(scope, locals) { -          var i = 0, val; -          do { -            val = cspSafeGetterFn( -                    pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++], fullExp, options -                  )(scope, locals); - -            locals = undefined; // clear after first iteration -            scope = val; -          } while (i < pathKeysLength); -          return val; -        } +    if (pathKeysLength < 6) { +      fn = cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4], fullExp, +                          options); +    } else { +      fn = function(scope, locals) { +        var i = 0, val; +        do { +          val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++], +                                pathKeys[i++], fullExp, options)(scope, locals); + +          locals = undefined; // clear after first iteration +          scope = val; +        } while (i < pathKeysLength); +        return val; +      }; +    }    } else {      var code = 'var l, fn, p;\n';      forEach(pathKeys, function(key, index) { @@ -1015,7 +1029,9 @@ function getterFn(path, options, fullExp) {      });      code += 'return s;'; -    var evaledFnGetter = Function('s', 'k', 'pw', code); // s=scope, k=locals, pw=promiseWarning +    /* jshint -W054 */ +    var evaledFnGetter = new Function('s', 'k', 'pw', code); // s=scope, k=locals, pw=promiseWarning +    /* jshint +W054 */      evaledFnGetter.toString = function() { return code; };      fn = function(scope, locals) {        return evaledFnGetter(scope, locals, promiseWarning); @@ -1079,7 +1095,8 @@ function getterFn(path, options, fullExp) {   * @function   *   * @description - * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse} service. + * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse} + *  service.   */  function $ParseProvider() {    var cache = {}; @@ -1101,35 +1118,40 @@ function $ParseProvider() {     *     * **This feature is deprecated, see deprecation notes below for more info**     * -   * If set to true (default is false), $parse will unwrap promises automatically when a promise is found at any part of -   * the expression. In other words, if set to true, the expression will always result in a non-promise value. +   * If set to true (default is false), $parse will unwrap promises automatically when a promise is +   * found at any part of the expression. In other words, if set to true, the expression will always +   * result in a non-promise value.     * -   * While the promise is unresolved, it's treated as undefined, but once resolved and fulfilled, the fulfillment value -   * is used in place of the promise while evaluating the expression. +   * While the promise is unresolved, it's treated as undefined, but once resolved and fulfilled, +   * the fulfillment value is used in place of the promise while evaluating the expression.     *     * **Deprecation notice**     * -   * This is a feature that didn't prove to be wildly useful or popular, primarily because of the dichotomy between data -   * access in templates (accessed as raw values) and controller code (accessed as promises). +   * This is a feature that didn't prove to be wildly useful or popular, primarily because of the +   * dichotomy between data access in templates (accessed as raw values) and controller code +   * (accessed as promises).     * -   * In most code we ended up resolving promises manually in controllers anyway and thus unifying the model access there. +   * In most code we ended up resolving promises manually in controllers anyway and thus unifying +   * the model access there.     *     * Other downsides of automatic promise unwrapping:     *     * - when building components it's often desirable to receive the raw promises     * - adds complexity and slows down expression evaluation -   * - makes expression code pre-generation unattractive due to the amount of code that needs to be generated +   * - makes expression code pre-generation unattractive due to the amount of code that needs to be +   *   generated     * - makes IDE auto-completion and tool support hard     *     * **Warning Logs**     * -   * If the unwrapping is enabled, Angular will log a warning about each expression that unwraps a promise (to reduce -   * the noise, each expression is logged only once). To disable this logging use +   * If the unwrapping is enabled, Angular will log a warning about each expression that unwraps a +   * promise (to reduce the noise, each expression is logged only once). To disable this logging use     * `$parseProvider.logPromiseWarnings(false)` api.     *     *     * @param {boolean=} value New value. -   * @returns {boolean|self} Returns the current setting when used as getter and self if used as setter. +   * @returns {boolean|self} Returns the current setting when used as getter and self if used as +   *                         setter.     */    this.unwrapPromises = function(value) {      if (isDefined(value)) { @@ -1156,7 +1178,8 @@ function $ParseProvider() {     * This setting applies only if `$parseProvider.unwrapPromises` setting is set to true as well.     *     * @param {boolean=} value New value. -   * @returns {boolean|self} Returns the current setting when used as getter and self if used as setter. +   * @returns {boolean|self} Returns the current setting when used as getter and self if used as +   *                         setter.     */   this.logPromiseWarnings = function(value) {      if (isDefined(value)) { diff --git a/src/ng/q.js b/src/ng/q.js index be5bd6f4..c363fdf1 100644 --- a/src/ng/q.js +++ b/src/ng/q.js @@ -50,8 +50,8 @@   * </pre>   *   * At first it might not be obvious why this extra complexity is worth the trouble. The payoff - * comes in the way of - * [guarantees that promise and deferred APIs make](https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md). + * comes in the way of guarantees that promise and deferred APIs make, see + * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.   *   * Additionally the promise api allows for composition that is very hard to do with the   * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach. @@ -98,8 +98,9 @@   *   provide a progress indication, before the promise is resolved or rejected.   *   *   This method *returns a new promise* which is resolved or rejected via the return value of the - *   `successCallback`, `errorCallback`. It also notifies via the return value of the `notifyCallback` - *   method. The promise can not be resolved or rejected from the notifyCallback method. + *   `successCallback`, `errorCallback`. It also notifies via the return value of the + *   `notifyCallback` method. The promise can not be resolved or rejected from the notifyCallback + *   method.   *   * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`   * @@ -115,8 +116,8 @@   *   * # Chaining promises   * - * Because calling the `then` method of a promise returns a new derived promise, it is easily possible - * to create a chain of promises: + * Because calling the `then` method of a promise returns a new derived promise, it is easily + * possible to create a chain of promises:   *   * <pre>   *   promiseB = promiseA.then(function(result) { @@ -479,9 +480,9 @@ function qFactory(nextTick, exceptionHandler) {     *     * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.     * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values, -   *   each value corresponding to the promise at the same index/key in the `promises` array/hash. If any of -   *   the promises is resolved with a rejection, this resulting promise will be rejected with the -   *   same rejection value. +   *   each value corresponding to the promise at the same index/key in the `promises` array/hash. +   *   If any of the promises is resolved with a rejection, this resulting promise will be rejected +   *   with the same rejection value.     */    function all(promises) {      var deferred = defer(), diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index da4e30c2..58aedd05 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -40,14 +40,18 @@   * @methodOf ng.$rootScopeProvider   * @description   * - * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and assuming that the model is unstable. + * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and + * assuming that the model is unstable.   *   * The current default is 10 iterations.   * - * In complex applications it's possible that the dependencies between `$watch`s will result in several digest iterations. - * However if an application needs more than the default 10 digest iterations for its model to stabilize then you should investigate what is causing the model to continuously change during the digest. + * In complex applications it's possible that the dependencies between `$watch`s will result in + * several digest iterations. However if an application needs more than the default 10 digest + * iterations for its model to stabilize then you should investigate what is causing the model to + * continuously change during the digest.   * - * Increasing the TTL could have performance implications, so you should not change it without proper justification. + * Increasing the TTL could have performance implications, so you should not change it without + * proper justification.   *   * @param {number} limit The number of digest iterations.   */ @@ -109,11 +113,12 @@ function $RootScopeProvider(){       * </pre>       *       * -     * @param {Object.<string, function()>=} providers Map of service factory which need to be provided -     *     for the current scope. Defaults to {@link ng}. +     * @param {Object.<string, function()>=} providers Map of service factory which need to be +     *                                       provided for the current scope. Defaults to {@link ng}.       * @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should -     *     append/override services provided by `providers`. This is handy when unit-testing and having -     *     the need to override a default service. +     *                              append/override services provided by `providers`. This is handy +     *                              when unit-testing and having the need to override a default +     *                              service.       * @returns {Object} Newly created scope.       *       */ @@ -151,12 +156,12 @@ function $RootScopeProvider(){         * Creates a new child {@link ng.$rootScope.Scope scope}.         *         * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} and -       * {@link ng.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the scope -       * hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}. +       * {@link ng.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the +       * scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.         * -       * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is desired for -       * the scope and its child scopes to be permanently detached from the parent and thus stop -       * participating in model change detection and listener notification by invoking. +       * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is +       * desired for the scope and its child scopes to be permanently detached from the parent and +       * thus stop participating in model change detection and listener notification by invoking.         *         * @param {boolean} isolate If true, then the scope does not prototypically inherit from the         *         parent scope. The scope is isolated, as it can not see parent scope properties. @@ -207,25 +212,26 @@ function $RootScopeProvider(){         * @description         * Registers a `listener` callback to be executed whenever the `watchExpression` changes.         * -       * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest $digest()} and -       *   should return the value that will be watched. (Since {@link ng.$rootScope.Scope#$digest $digest()} -       *   reruns when it detects changes the `watchExpression` can execute multiple times per +       * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest +       *   $digest()} and should return the value that will be watched. (Since +       *   {@link ng.$rootScope.Scope#$digest $digest()} reruns when it detects changes the +       *   `watchExpression` can execute multiple times per         *   {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)         * - The `listener` is called only when the value from the current `watchExpression` and the         *   previous call to `watchExpression` are not equal (with the exception of the initial run,         *   see below). The inequality is determined according to -       *   {@link angular.equals} function. To save the value of the object for later comparison, the -       *   {@link angular.copy} function is used. It also means that watching complex options will -       *   have adverse memory and performance implications. -       * - The watch `listener` may change the model, which may trigger other `listener`s to fire. This -       *   is achieved by rerunning the watchers until no changes are detected. The rerun iteration -       *   limit is 10 to prevent an infinite loop deadlock. +       *   {@link angular.equals} function. To save the value of the object for later comparison, +       *   the {@link angular.copy} function is used. It also means that watching complex options +       *   will have adverse memory and performance implications. +       * - The watch `listener` may change the model, which may trigger other `listener`s to fire. +       *   This is achieved by rerunning the watchers until no changes are detected. The rerun +       *   iteration limit is 10 to prevent an infinite loop deadlock.         *         *         * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,         * you can register a `watchExpression` function with no `listener`. (Since `watchExpression` -       * can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a change is -       * detected, be prepared for multiple calls to your listener.) +       * can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a +       * change is detected, be prepared for multiple calls to your listener.)         *         * After a watcher is registered with the scope, the `listener` fn is called asynchronously         * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the @@ -243,7 +249,9 @@ function $RootScopeProvider(){             scope.counter = 0;             expect(scope.counter).toEqual(0); -           scope.$watch('name', function(newValue, oldValue) { scope.counter = scope.counter + 1; }); +           scope.$watch('name', function(newValue, oldValue) { +             scope.counter = scope.counter + 1; +           });             expect(scope.counter).toEqual(0);             scope.$digest(); @@ -258,8 +266,8 @@ function $RootScopeProvider(){         *         *         * @param {(function()|string)} watchExpression Expression that is evaluated on each -       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers a -       *    call to the `listener`. +       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers +       *    a call to the `listener`.         *         *    - `string`: Evaluated as {@link guide/expression expression}         *    - `function(scope)`: called with current `scope` as a parameter. @@ -267,7 +275,8 @@ function $RootScopeProvider(){         *   the `watchExpression` changes.         *         *    - `string`: Evaluated as {@link guide/expression expression} -       *    - `function(newValue, oldValue, scope)`: called with current and previous values as parameters. +       *    - `function(newValue, oldValue, scope)`: called with current and previous values as +       *      parameters.         *         * @param {boolean=} objectEquality Compare object for equality rather than for reference.         * @returns {function()} Returns a deregistration function for this listener. @@ -319,13 +328,13 @@ function $RootScopeProvider(){         *         * @description         * Shallow watches the properties of an object and fires whenever any of the properties change -       * (for arrays, this implies watching the array items; for object maps, this implies watching the properties). -       * If a change is detected, the `listener` callback is fired. +       * (for arrays, this implies watching the array items; for object maps, this implies watching +       * the properties). If a change is detected, the `listener` callback is fired.         * -       * - The `obj` collection is observed via standard $watch operation and is examined on every call to $digest() to -       *   see if any items have been added, removed, or moved. -       * - The `listener` is called whenever anything within the `obj` has changed. Examples include adding, removing, -       *   and moving items belonging to an object or array. +       * - The `obj` collection is observed via standard $watch operation and is examined on every +       *   call to $digest() to see if any items have been added, removed, or moved. +       * - The `listener` is called whenever anything within the `obj` has changed. Examples include +       *   adding, removing, and moving items belonging to an object or array.         *         *         * # Example @@ -351,19 +360,19 @@ function $RootScopeProvider(){         * </pre>         *         * -       * @param {string|Function(scope)} obj Evaluated as {@link guide/expression expression}. The expression value -       *    should evaluate to an object or an array which is observed on each -       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the collection will trigger -       *    a call to the `listener`. +       * @param {string|Function(scope)} obj Evaluated as {@link guide/expression expression}. The +       *    expression value should evaluate to an object or an array which is observed on each +       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the +       *    collection will trigger a call to the `listener`.         * -       * @param {function(newCollection, oldCollection, scope)} listener a callback function that is fired with both -       *    the `newCollection` and `oldCollection` as parameters. -       *    The `newCollection` object is the newly modified data obtained from the `obj` expression and the -       *    `oldCollection` object is a copy of the former collection data. +       * @param {function(newCollection, oldCollection, scope)} listener a callback function that is +       *    fired with both the `newCollection` and `oldCollection` as parameters. +       *    The `newCollection` object is the newly modified data obtained from the `obj` expression +       *    and the `oldCollection` object is a copy of the former collection data.         *    The `scope` refers to the current scope.         * -       * @returns {function()} Returns a de-registration function for this listener. When the de-registration function -       * is executed, the internal watch operation is terminated. +       * @returns {function()} Returns a de-registration function for this listener. When the +       *    de-registration function is executed, the internal watch operation is terminated.         */        $watchCollection: function(obj, listener) {          var self = this; @@ -458,21 +467,22 @@ function $RootScopeProvider(){         * @function         *         * @description -       * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and its children. -       * Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change the model, the -       * `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} until no more listeners are -       * firing. This means that it is possible to get into an infinite loop. This function will throw -       * `'Maximum iteration limit exceeded.'` if the number of iterations exceeds 10. +       * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and +       * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change +       * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} +       * until no more listeners are firing. This means that it is possible to get into an infinite +       * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of +       * iterations exceeds 10.         *         * Usually, you don't call `$digest()` directly in         * {@link ng.directive:ngController controllers} or in         * {@link ng.$compileProvider#methods_directive directives}. -       * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within a -       * {@link ng.$compileProvider#methods_directive directives}), which will force a `$digest()`. +       * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within +       * a {@link ng.$compileProvider#methods_directive directives}), which will force a `$digest()`.         *         * If you want to be notified whenever `$digest()` is called, -       * you can register a `watchExpression` function with {@link ng.$rootScope.Scope#$watch $watch()} -       * with no `listener`. +       * you can register a `watchExpression` function with +       * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.         *         * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.         * @@ -570,7 +580,8 @@ function $RootScopeProvider(){            if(dirty && !(ttl--)) {              clearPhase();              throw $rootScopeMinErr('infdig', -                '{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}', +                '{0} $digest() iterations reached. Aborting!\n' + +                'Watchers fired in the last 5 iterations: {1}',                  TTL, toJson(watchLog));            }          } while (dirty || asyncQueue.length); @@ -649,8 +660,9 @@ function $RootScopeProvider(){         * @function         *         * @description -       * Executes the `expression` on the current scope and returns the result. Any exceptions in the -       * expression are propagated (uncaught). This is useful when evaluating Angular expressions. +       * Executes the `expression` on the current scope and returns the result. Any exceptions in +       * the expression are propagated (uncaught). This is useful when evaluating Angular +       * expressions.         *         * # Example         * <pre> @@ -682,17 +694,20 @@ function $RootScopeProvider(){         * @description         * Executes the expression on the current scope at a later point in time.         * -       * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only that: +       * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only +       * that:         * -       *   - it will execute after the function that scheduled the evaluation (preferably before DOM rendering). -       *   - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after `expression` execution. +       *   - it will execute after the function that scheduled the evaluation (preferably before DOM +       *     rendering). +       *   - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after +       *     `expression` execution.         *         * Any exceptions from the execution of the expression are forwarded to the         * {@link ng.$exceptionHandler $exceptionHandler} service.         * -       * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle will be scheduled. -       * However, it is encouraged to always call code that changes the model from within an `$apply` call. -       * That includes code evaluated via `$evalAsync`. +       * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle +       * will be scheduled. However, it is encouraged to always call code that changes the model +       * from within an `$apply` call. That includes code evaluated via `$evalAsync`.         *         * @param {(string|function())=} expression An angular expression to be executed.         * @@ -701,8 +716,8 @@ function $RootScopeProvider(){         *         */        $evalAsync: function(expr) { -        // if we are outside of an $digest loop and this is the first time we are scheduling async task also schedule -        // async auto-flush +        // if we are outside of an $digest loop and this is the first time we are scheduling async +        // task also schedule async auto-flush          if (!$rootScope.$$phase && !$rootScope.$$asyncQueue.length) {            $browser.defer(function() {              if ($rootScope.$$asyncQueue.length) { @@ -725,10 +740,10 @@ function $RootScopeProvider(){         * @function         *         * @description -       * `$apply()` is used to execute an expression in angular from outside of the angular framework. -       * (For example from browser DOM events, setTimeout, XHR or third party libraries). -       * Because we are calling into the angular framework we need to perform proper scope life cycle -       * of {@link ng.$exceptionHandler exception handling}, +       * `$apply()` is used to execute an expression in angular from outside of the angular +       * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries). +       * Because we are calling into the angular framework we need to perform proper scope life +       * cycle of {@link ng.$exceptionHandler exception handling},         * {@link ng.$rootScope.Scope#$digest executing watches}.         *         * ## Life cycle @@ -753,8 +768,8 @@ function $RootScopeProvider(){         *    {@link ng.$rootScope.Scope#$eval $eval()} method.         * 2. Any exceptions from the execution of the expression are forwarded to the         *    {@link ng.$exceptionHandler $exceptionHandler} service. -       * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the expression -       *    was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method. +       * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the +       *    expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.         *         *         * @param {(string|function())=} exp An angular expression to be executed. @@ -788,18 +803,20 @@ function $RootScopeProvider(){         * @function         *         * @description -       * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for discussion of -       * event life cycle. +       * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for +       * discussion of event life cycle.         *         * The event listener function format is: `function(event, args...)`. The `event` object         * passed into the listener has the following attributes:         * -       *   - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or `$broadcast`-ed. +       *   - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or +       *     `$broadcast`-ed.         *   - `currentScope` - `{Scope}`: the current scope which is handling the event.         *   - `name` - `{string}`: name of the event. -       *   - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel further event -       *     propagation (available only for events that were `$emit`-ed). -       *   - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag to true. +       *   - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel +       *     further event propagation (available only for events that were `$emit`-ed). +       *   - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag +       *     to true.         *   - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.         *         * @param {string} name Event name to listen on. @@ -830,9 +847,10 @@ function $RootScopeProvider(){         * registered {@link ng.$rootScope.Scope#$on} listeners.         *         * The event life cycle starts at the scope on which `$emit` was called. All -       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified. -       * Afterwards, the event traverses upwards toward the root scope and calls all registered -       * listeners along the way. The event will stop propagating if one of the listeners cancels it. +       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get +       * notified. Afterwards, the event traverses upwards toward the root scope and calls all +       * registered listeners along the way. The event will stop propagating if one of the listeners +       * cancels it.         *         * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed         * onto the {@link ng.$exceptionHandler $exceptionHandler} service. @@ -898,9 +916,9 @@ function $RootScopeProvider(){         * registered {@link ng.$rootScope.Scope#$on} listeners.         *         * The event life cycle starts at the scope on which `$broadcast` was called. All -       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified. -       * Afterwards, the event propagates to all direct and indirect scopes of the current scope and -       * calls all registered listeners along the way. The event cannot be canceled. +       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get +       * notified. Afterwards, the event propagates to all direct and indirect scopes of the current +       * scope and calls all registered listeners along the way. The event cannot be canceled.         *         * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed         * onto the {@link ng.$exceptionHandler $exceptionHandler} service. diff --git a/src/ng/sce.js b/src/ng/sce.js index 8c4fde17..8f231031 100644 --- a/src/ng/sce.js +++ b/src/ng/sce.js @@ -20,7 +20,7 @@ var SCE_CONTEXTS = {  function escapeForRegexp(s) {    return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1').             replace(/\x08/g, '\\x08'); -}; +}  function adjustMatcher(matcher) { @@ -144,8 +144,8 @@ function $SceDelegateProvider() {     *     provided.  This must be an array or null.  A snapshot of this array is used so further     *     changes to the array are ignored.     * -   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items allowed in -   *     this array. +   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items +   *     allowed in this array.     *     *     Note: **an empty whitelist array will block all URLs**!     * @@ -174,19 +174,19 @@ function $SceDelegateProvider() {     *     provided.  This must be an array or null.  A snapshot of this array is used so further     *     changes to the array are ignored.     * -   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items allowed in -   *     this array. +   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items +   *     allowed in this array.     * -   *     The typical usage for the blacklist is to **block [open redirects](http://cwe.mitre.org/data/definitions/601.html)** -   *     served by your domain as these would otherwise be trusted but actually return content from the redirected -   *     domain. +   *     The typical usage for the blacklist is to **block +   *     [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as +   *     these would otherwise be trusted but actually return content from the redirected domain.     *     *     Finally, **the blacklist overrides the whitelist** and has the final say.     *     * @return {Array} the currently set blacklist array.     * -   * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there is -   * no blacklist.) +   * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there +   * is no blacklist.)     *     * @description     * Sets/Gets the blacklist of trusted resource URLs. @@ -242,21 +242,21 @@ function $SceDelegateProvider() {        return allowed;      } -    function generateHolderType(base) { +    function generateHolderType(Base) {        var holderType = function TrustedValueHolderType(trustedValue) {          this.$$unwrapTrustedValue = function() {            return trustedValue;          };        }; -      if (base) { -        holderType.prototype = new base(); +      if (Base) { +        holderType.prototype = new Base();        }        holderType.prototype.valueOf = function sceValueOf() {          return this.$$unwrapTrustedValue(); -      } +      };        holderType.prototype.toString = function sceToString() {          return this.$$unwrapTrustedValue().toString(); -      } +      };        return holderType;      } @@ -288,9 +288,10 @@ function $SceDelegateProvider() {       * where Angular expects a $sce.trustAs() return value.       */      function trustAs(type, trustedValue) { -      var constructor = (byType.hasOwnProperty(type) ? byType[type] : null); -      if (!constructor) { -        throw $sceMinErr('icontext', 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}', +      var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null); +      if (!Constructor) { +        throw $sceMinErr('icontext', +            'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',              type, trustedValue);        }        if (trustedValue === null || trustedValue === undefined || trustedValue === '') { @@ -303,7 +304,7 @@ function $SceDelegateProvider() {              'Attempted to trust a non-string value in a content requiring a string: Context: {0}',              type);        } -      return new constructor(trustedValue); +      return new Constructor(trustedValue);      }      /** @@ -322,8 +323,8 @@ function $SceDelegateProvider() {       * @param {*} value The result of a prior {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`}       *      call or anything else.       * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#methods_trustAs -     *     `$sceDelegate.trustAs`} if `value` is the result of such a call.  Otherwise, returns `value` -     *     unchanged. +     *     `$sceDelegate.trustAs`} if `value` is the result of such a call.  Otherwise, returns +     *     `value` unchanged.       */      function valueOf(maybeTrusted) {        if (maybeTrusted instanceof trustedValueHolderBase) { @@ -339,13 +340,13 @@ function $SceDelegateProvider() {       * @methodOf ng.$sceDelegate       *       * @description -     * Takes the result of a {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`} call and returns the -     * originally supplied value if the queried context type is a supertype of the created type.  If -     * this condition isn't satisfied, throws an exception. +     * Takes the result of a {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`} call and +     * returns the originally supplied value if the queried context type is a supertype of the +     * created type.  If this condition isn't satisfied, throws an exception.       *       * @param {string} type The kind of context in which this value is to be used.       * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#methods_trustAs -     * `$sceDelegate.trustAs`} call. +     *     `$sceDelegate.trustAs`} call.       * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#methods_trustAs       *     `$sceDelegate.trustAs`} if valid in this context.  Otherwise, throws an exception.       */ @@ -365,7 +366,8 @@ function $SceDelegateProvider() {            return maybeTrusted;          } else {            throw $sceMinErr('insecurl', -              'Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}', maybeTrusted.toString()); +              'Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}', +              maybeTrusted.toString());          }        } else if (type === SCE_CONTEXTS.HTML) {          return htmlSanitizer(maybeTrusted); @@ -392,6 +394,8 @@ function $SceDelegateProvider() {   * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.   */ +/* jshint maxlen: false*/ +  /**   * @ngdoc service   * @name ng.$sce @@ -448,9 +452,9 @@ function $SceDelegateProvider() {   * allowing only the files in a specific directory to do this.  Ensuring that the internal API   * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.   * - * In the case of AngularJS' SCE service, one uses {@link ng.$sce#methods_trustAs $sce.trustAs} (and shorthand - * methods such as {@link ng.$sce#methods_trustAsHtml $sce.trustAsHtml}, etc.) to obtain values that will be - * accepted by SCE / privileged contexts. + * In the case of AngularJS' SCE service, one uses {@link ng.$sce#methods_trustAs $sce.trustAs}  + * (and shorthand methods such as {@link ng.$sce#methods_trustAsHtml $sce.trustAsHtml}, etc.) to + * obtain values that will be accepted by SCE / privileged contexts.   *   *   * ## How does it work? @@ -577,60 +581,63 @@ function $SceDelegateProvider() {   * ## Show me an example using SCE.   *   * @example - <example module="mySceApp"> -  <file name="index.html"> -    <div ng-controller="myAppController as myCtrl"> -      <i ng-bind-html="myCtrl.explicitlyTrustedHtml" id="explicitlyTrustedHtml"></i><br><br> -      <b>User comments</b><br> -      By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when $sanitize is available.  If $sanitize isn't available, this results in an error instead of an exploit. -      <div class="well"> -        <div ng-repeat="userComment in myCtrl.userComments"> -          <b>{{userComment.name}}</b>: -          <span ng-bind-html="userComment.htmlComment" class="htmlComment"></span> -          <br> -        </div> +<example module="mySceApp"> +<file name="index.html"> +  <div ng-controller="myAppController as myCtrl"> +    <i ng-bind-html="myCtrl.explicitlyTrustedHtml" id="explicitlyTrustedHtml"></i><br><br> +    <b>User comments</b><br> +    By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when +    $sanitize is available.  If $sanitize isn't available, this results in an error instead of an +    exploit. +    <div class="well"> +      <div ng-repeat="userComment in myCtrl.userComments"> +        <b>{{userComment.name}}</b>: +        <span ng-bind-html="userComment.htmlComment" class="htmlComment"></span> +        <br>        </div>      </div> -  </file> +  </div> +</file> + +<file name="script.js"> +  var mySceApp = angular.module('mySceApp', ['ngSanitize']); -  <file name="script.js"> -    var mySceApp = angular.module('mySceApp', ['ngSanitize']); +  mySceApp.controller("myAppController", function myAppController($http, $templateCache, $sce) { +    var self = this; +    $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) { +      self.userComments = userComments; +    }); +    self.explicitlyTrustedHtml = $sce.trustAsHtml( +        '<span onmouseover="this.textContent="Explicitly trusted HTML bypasses ' + +        'sanitization."">Hover over this text.</span>'); +  }); +</file> + +<file name="test_data.json"> +[ +  { "name": "Alice", +    "htmlComment": +        "<span onmouseover='this.textContent=\"PWN3D!\"'>Is <i>anyone</i> reading this?</span>" +  }, +  { "name": "Bob", +    "htmlComment": "<i>Yes!</i>  Am I the only other one?" +  } +] +</file> -    mySceApp.controller("myAppController", function myAppController($http, $templateCache, $sce) { -      var self = this; -      $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) { -        self.userComments = userComments; -      }); -      self.explicitlyTrustedHtml = $sce.trustAsHtml( +<file name="scenario.js"> +  describe('SCE doc demo', function() { +    it('should sanitize untrusted values', function() { +      expect(element('.htmlComment').html()).toBe('<span>Is <i>anyone</i> reading this?</span>'); +    }); +    it('should NOT sanitize explicitly trusted values', function() { +      expect(element('#explicitlyTrustedHtml').html()).toBe(            '<span onmouseover="this.textContent="Explicitly trusted HTML bypasses ' +            'sanitization."">Hover over this text.</span>');      }); -  </file> - -  <file name="test_data.json"> -    [ -      { "name": "Alice", -        "htmlComment": "<span onmouseover='this.textContent=\"PWN3D!\"'>Is <i>anyone</i> reading this?</span>" -      }, -      { "name": "Bob", -        "htmlComment": "<i>Yes!</i>  Am I the only other one?" -      } -    ] -  </file> - -  <file name="scenario.js"> -    describe('SCE doc demo', function() { -      it('should sanitize untrusted values', function() { -        expect(element('.htmlComment').html()).toBe('<span>Is <i>anyone</i> reading this?</span>'); -      }); -      it('should NOT sanitize explicitly trusted values', function() { -        expect(element('#explicitlyTrustedHtml').html()).toBe( -            '<span onmouseover="this.textContent="Explicitly trusted HTML bypasses ' + -            'sanitization."">Hover over this text.</span>'); -      }); -    }); -  </file> - </example> +  }); +</file> +</example>   *   *   * @@ -653,6 +660,7 @@ function $SceDelegateProvider() {   * </pre>   *   */ +/* jshint maxlen: 100 */  function $SceProvider() {    var enabled = true; @@ -698,13 +706,13 @@ function $SceProvider() {     *     This function should return the a value that is safe to use in the context specified by     *     contextEnum or throw and exception otherwise.     * -   * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be opaque -   * or wrapped in some holder object.  That happens to be an implementation detail.  For instance, -   * an implementation could maintain a registry of all trusted objects by context.  In such a case, -   * trustAs() would return the same object that was passed in.  getTrusted() would return the same -   * object passed in if it was found in the registry under a compatible context or throw an -   * exception otherwise.  An implementation might only wrap values some of the time based on -   * some criteria.  getTrusted() might return a value and not throw an exception for special +   * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be +   * opaque or wrapped in some holder object.  That happens to be an implementation detail.  For +   * instance, an implementation could maintain a registry of all trusted objects by context.  In +   * such a case, trustAs() would return the same object that was passed in.  getTrusted() would +   * return the same object passed in if it was found in the registry under a compatible context or +   * throw an exception otherwise.  An implementation might only wrap values some of the time based +   * on some criteria.  getTrusted() might return a value and not throw an exception for special     * constants or objects even if not wrapped.  All such implementations fulfill this contract.     *     * @@ -759,8 +767,8 @@ function $SceProvider() {      sce.valueOf = $sceDelegate.valueOf;      if (!enabled) { -      sce.trustAs = sce.getTrusted = function(type, value) { return value; }, -      sce.valueOf = identity +      sce.trustAs = sce.getTrusted = function(type, value) { return value; }; +      sce.valueOf = identity;      }      /** @@ -790,7 +798,7 @@ function $SceProvider() {        } else {          return function sceParseAsTrusted(self, locals) {            return sce.getTrusted(type, parsed(self, locals)); -        } +        };        }      }; @@ -800,11 +808,12 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Delegates to {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`}.  As such, returns an object -     * that is trusted by angular for use in specified strict contextual escaping contexts (such as -     * ng-html-bind-unsafe, ng-include, any src attribute interpolation, any dom event binding -     * attribute interpolation such as for onclick,  etc.) that uses the provided value.  See * -     * {@link ng.$sce $sce} for enabling strict contextual escaping. +     * Delegates to {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`}.  As such, +     * returns an objectthat is trusted by angular for use in specified strict contextual +     * escaping contexts (such as ng-html-bind-unsafe, ng-include, any src attribute +     * interpolation, any dom event binding attribute interpolation such as for onclick,  etc.) +     * that uses the provided value.  See * {@link ng.$sce $sce} for enabling strict contextual +     * escaping.       *       * @param {string} type The kind of context in which this value is safe for use.  e.g. url,       *   resource_url, html, js and css. @@ -819,7 +828,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.trustAsHtml(value)` → {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs($sce.HTML, value)`} +     * Shorthand method.  `$sce.trustAsHtml(value)` → +     *     {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs($sce.HTML, value)`}       *       * @param {*} value The value to trustAs.       * @returns {*} An object that can be passed to {@link ng.$sce#methods_getTrustedHtml @@ -834,7 +844,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.trustAsUrl(value)` → {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs($sce.URL, value)`} +     * Shorthand method.  `$sce.trustAsUrl(value)` → +     *     {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs($sce.URL, value)`}       *       * @param {*} value The value to trustAs.       * @returns {*} An object that can be passed to {@link ng.$sce#methods_getTrustedUrl @@ -849,7 +860,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.trustAsResourceUrl(value)` → {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`} +     * Shorthand method.  `$sce.trustAsResourceUrl(value)` → +     *     {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}       *       * @param {*} value The value to trustAs.       * @returns {*} An object that can be passed to {@link ng.$sce#methods_getTrustedResourceUrl @@ -864,7 +876,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.trustAsJs(value)` → {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs($sce.JS, value)`} +     * Shorthand method.  `$sce.trustAsJs(value)` → +     *     {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs($sce.JS, value)`}       *       * @param {*} value The value to trustAs.       * @returns {*} An object that can be passed to {@link ng.$sce#methods_getTrustedJs @@ -879,15 +892,17 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Delegates to {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted`}.  As such, takes -     * the result of a {@link ng.$sce#methods_trustAs `$sce.trustAs`}() call and returns the originally supplied -     * value if the queried context type is a supertype of the created type.  If this condition -     * isn't satisfied, throws an exception. +     * Delegates to {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted`}.  As such, +     * takes the result of a {@link ng.$sce#methods_trustAs `$sce.trustAs`}() call and returns the +     * originally supplied value if the queried context type is a supertype of the created type. +     * If this condition isn't satisfied, throws an exception.       *       * @param {string} type The kind of context in which this value is to be used. -     * @param {*} maybeTrusted The result of a prior {@link ng.$sce#methods_trustAs `$sce.trustAs`} call. -     * @returns {*} The value the was originally provided to {@link ng.$sce#methods_trustAs `$sce.trustAs`} if -     *     valid in this context.  Otherwise, throws an exception. +     * @param {*} maybeTrusted The result of a prior {@link ng.$sce#methods_trustAs `$sce.trustAs`} +     *                         call. +     * @returns {*} The value the was originally provided to +     *              {@link ng.$sce#methods_trustAs `$sce.trustAs`} if valid in this context. +     *              Otherwise, throws an exception.       */      /** @@ -896,7 +911,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.getTrustedHtml(value)` → {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`} +     * Shorthand method.  `$sce.getTrustedHtml(value)` → +     *     {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}       *       * @param {*} value The value to pass to `$sce.getTrusted`.       * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)` @@ -908,7 +924,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.getTrustedCss(value)` → {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`} +     * Shorthand method.  `$sce.getTrustedCss(value)` → +     *     {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}       *       * @param {*} value The value to pass to `$sce.getTrusted`.       * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)` @@ -920,7 +937,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.getTrustedUrl(value)` → {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted($sce.URL, value)`} +     * Shorthand method.  `$sce.getTrustedUrl(value)` → +     *     {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}       *       * @param {*} value The value to pass to `$sce.getTrusted`.       * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)` @@ -932,7 +950,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.getTrustedResourceUrl(value)` → {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`} +     * Shorthand method.  `$sce.getTrustedResourceUrl(value)` → +     *     {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}       *       * @param {*} value The value to pass to `$sceDelegate.getTrusted`.       * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)` @@ -944,7 +963,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.getTrustedJs(value)` → {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted($sce.JS, value)`} +     * Shorthand method.  `$sce.getTrustedJs(value)` → +     *     {@link ng.$sceDelegate#methods_getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}       *       * @param {*} value The value to pass to `$sce.getTrusted`.       * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)` @@ -956,7 +976,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.parseAsHtml(expression string)` → {@link ng.$sce#methods_parse `$sce.parseAs($sce.HTML, value)`} +     * Shorthand method.  `$sce.parseAsHtml(expression string)` → +     *     {@link ng.$sce#methods_parse `$sce.parseAs($sce.HTML, value)`}       *       * @param {string} expression String expression to compile.       * @returns {function(context, locals)} a function which represents the compiled expression: @@ -973,7 +994,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.parseAsCss(value)` → {@link ng.$sce#methods_parse `$sce.parseAs($sce.CSS, value)`} +     * Shorthand method.  `$sce.parseAsCss(value)` → +     *     {@link ng.$sce#methods_parse `$sce.parseAs($sce.CSS, value)`}       *       * @param {string} expression String expression to compile.       * @returns {function(context, locals)} a function which represents the compiled expression: @@ -990,7 +1012,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.parseAsUrl(value)` → {@link ng.$sce#methods_parse `$sce.parseAs($sce.URL, value)`} +     * Shorthand method.  `$sce.parseAsUrl(value)` → +     *     {@link ng.$sce#methods_parse `$sce.parseAs($sce.URL, value)`}       *       * @param {string} expression String expression to compile.       * @returns {function(context, locals)} a function which represents the compiled expression: @@ -1007,7 +1030,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.parseAsResourceUrl(value)` → {@link ng.$sce#methods_parse `$sce.parseAs($sce.RESOURCE_URL, value)`} +     * Shorthand method.  `$sce.parseAsResourceUrl(value)` → +     *     {@link ng.$sce#methods_parse `$sce.parseAs($sce.RESOURCE_URL, value)`}       *       * @param {string} expression String expression to compile.       * @returns {function(context, locals)} a function which represents the compiled expression: @@ -1024,7 +1048,8 @@ function $SceProvider() {       * @methodOf ng.$sce       *       * @description -     * Shorthand method.  `$sce.parseAsJs(value)` → {@link ng.$sce#methods_parse `$sce.parseAs($sce.JS, value)`} +     * Shorthand method.  `$sce.parseAsJs(value)` → +     *     {@link ng.$sce#methods_parse `$sce.parseAs($sce.JS, value)`}       *       * @param {string} expression String expression to compile.       * @returns {function(context, locals)} a function which represents the compiled expression: @@ -1044,13 +1069,13 @@ function $SceProvider() {        var lName = lowercase(name);        sce[camelCase("parse_as_" + lName)] = function (expr) {          return parse(enumValue, expr); -      } +      };        sce[camelCase("get_trusted_" + lName)] = function (value) {          return getTrusted(enumValue, value); -      } +      };        sce[camelCase("trust_as_" + lName)] = function (value) {          return trustAs(enumValue, value); -      } +      };      });      return sce; diff --git a/src/ng/sniffer.js b/src/ng/sniffer.js index 9a7447cb..8dcfcd7d 100644 --- a/src/ng/sniffer.js +++ b/src/ng/sniffer.js @@ -18,7 +18,8 @@  function $SnifferProvider() {    this.$get = ['$window', '$document', function($window, $document) {      var eventSupport = {}, -        android = int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), +        android = +          int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),          boxee = /Boxee/i.test(($window.navigator || {}).userAgent),          document = $document[0] || {},          vendorPrefix, @@ -59,7 +60,10 @@ function $SnifferProvider() {        // older webit browser (533.9) on Boxee box has exactly the same problem as Android has        // so let's not use the history API also +      // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined +      // jshint -W018        history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee), +      // jshint +W018        hashchange: 'onhashchange' in $window &&                    // IE8 compatible mode lies                    (!document.documentMode || document.documentMode > 7), diff --git a/src/ng/urlUtils.js b/src/ng/urlUtils.js index 50156e6b..e821c08a 100644 --- a/src/ng/urlUtils.js +++ b/src/ng/urlUtils.js @@ -81,7 +81,8 @@ function urlResolve(url) {      hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',      hostname: urlParsingNode.hostname,      port: urlParsingNode.port, -    pathname: urlParsingNode.pathname && urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname +    pathname: urlParsingNode.pathname && urlParsingNode.pathname.charAt(0) === '/' ? +        urlParsingNode.pathname : '/' + urlParsingNode.pathname    };  } diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index a58e02d2..20b9101e 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -1,3 +1,6 @@ +'use strict'; +/* jshint maxlen: false */ +  /**   * @ngdoc overview   * @name ngAnimate @@ -474,7 +477,7 @@ angular.module('ngAnimate', ['ng'])              break;              default: -              value = !rootAnimateState.running +              value = !rootAnimateState.running;              break;            }            return !!value; @@ -505,7 +508,7 @@ angular.module('ngAnimate', ['ng'])          //skip the animation if animations are disabled, a parent is already being animated          //or the element is not currently attached to the document body. -        if ((parent.inheritedData(NG_ANIMATE_STATE) || disabledAnimation).running || animations.length == 0) { +        if ((parent.inheritedData(NG_ANIMATE_STATE) || disabledAnimation).running || animations.length === 0) {            done();            return;          } @@ -686,7 +689,7 @@ angular.module('ngAnimate', ['ng'])                  var aDuration  = parseMaxTime(elementStyles[animationProp + durationKey]);                  if(aDuration > 0) { -                  aDuration *= parseInt(elementStyles[animationProp + animationIterationCountKey]) || 1; +                  aDuration *= parseInt(elementStyles[animationProp + animationIterationCountKey], 10) || 1;                  }                  animationDuration = Math.max(aDuration, animationDuration); @@ -782,7 +785,7 @@ angular.module('ngAnimate', ['ng'])              if(cancelled) {                done();              } -          } +          };          }          else {            element.removeClass(className); diff --git a/src/ngCookies/cookies.js b/src/ngCookies/cookies.js index 2f9dd333..206e8708 100644 --- a/src/ngCookies/cookies.js +++ b/src/ngCookies/cookies.js @@ -75,7 +75,8 @@ angular.module('ngCookies', ['ng']).        /** -       * Pushes all the cookies from the service to the browser and verifies if all cookies were stored. +       * Pushes all the cookies from the service to the browser and verifies if all cookies were +       * stored.         */        function push() {          var name, diff --git a/src/ngLocale/angular-locale_af-na.js b/src/ngLocale/angular-locale_af-na.js index 6b7e2850..e40bd166 100644 --- a/src/ngLocale/angular-locale_af-na.js +++ b/src/ngLocale/angular-locale_af-na.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_af-za.js b/src/ngLocale/angular-locale_af-za.js index a15813d0..dddd6cae 100644 --- a/src/ngLocale/angular-locale_af-za.js +++ b/src/ngLocale/angular-locale_af-za.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_af.js b/src/ngLocale/angular-locale_af.js index d8f84509..aacbefd8 100644 --- a/src/ngLocale/angular-locale_af.js +++ b/src/ngLocale/angular-locale_af.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_am-et.js b/src/ngLocale/angular-locale_am-et.js index 06402024..decae2de 100644 --- a/src/ngLocale/angular-locale_am-et.js +++ b/src/ngLocale/angular-locale_am-et.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_am.js b/src/ngLocale/angular-locale_am.js index 26c8244e..6a7ad5f3 100644 --- a/src/ngLocale/angular-locale_am.js +++ b/src/ngLocale/angular-locale_am.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-001.js b/src/ngLocale/angular-locale_ar-001.js index ee6aca0f..9ed1dae1 100644 --- a/src/ngLocale/angular-locale_ar-001.js +++ b/src/ngLocale/angular-locale_ar-001.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-ae.js b/src/ngLocale/angular-locale_ar-ae.js index 6f4f501e..2440d71e 100644 --- a/src/ngLocale/angular-locale_ar-ae.js +++ b/src/ngLocale/angular-locale_ar-ae.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-bh.js b/src/ngLocale/angular-locale_ar-bh.js index 1b32a5bb..bb532894 100644 --- a/src/ngLocale/angular-locale_ar-bh.js +++ b/src/ngLocale/angular-locale_ar-bh.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-dz.js b/src/ngLocale/angular-locale_ar-dz.js index b4bdf08e..ab02398e 100644 --- a/src/ngLocale/angular-locale_ar-dz.js +++ b/src/ngLocale/angular-locale_ar-dz.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-eg.js b/src/ngLocale/angular-locale_ar-eg.js index 2e40e63a..1a45444f 100644 --- a/src/ngLocale/angular-locale_ar-eg.js +++ b/src/ngLocale/angular-locale_ar-eg.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-iq.js b/src/ngLocale/angular-locale_ar-iq.js index c8e8af85..a141d147 100644 --- a/src/ngLocale/angular-locale_ar-iq.js +++ b/src/ngLocale/angular-locale_ar-iq.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-jo.js b/src/ngLocale/angular-locale_ar-jo.js index 752de356..67e5d70b 100644 --- a/src/ngLocale/angular-locale_ar-jo.js +++ b/src/ngLocale/angular-locale_ar-jo.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-kw.js b/src/ngLocale/angular-locale_ar-kw.js index 7e812721..7507c5ac 100644 --- a/src/ngLocale/angular-locale_ar-kw.js +++ b/src/ngLocale/angular-locale_ar-kw.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-lb.js b/src/ngLocale/angular-locale_ar-lb.js index b1f9ce1d..8c867b63 100644 --- a/src/ngLocale/angular-locale_ar-lb.js +++ b/src/ngLocale/angular-locale_ar-lb.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-ly.js b/src/ngLocale/angular-locale_ar-ly.js index 5f09f8a3..4b59d399 100644 --- a/src/ngLocale/angular-locale_ar-ly.js +++ b/src/ngLocale/angular-locale_ar-ly.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-ma.js b/src/ngLocale/angular-locale_ar-ma.js index e08616be..44fcfccd 100644 --- a/src/ngLocale/angular-locale_ar-ma.js +++ b/src/ngLocale/angular-locale_ar-ma.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-om.js b/src/ngLocale/angular-locale_ar-om.js index 343ace3c..822aede1 100644 --- a/src/ngLocale/angular-locale_ar-om.js +++ b/src/ngLocale/angular-locale_ar-om.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-qa.js b/src/ngLocale/angular-locale_ar-qa.js index 0ecd38ae..f7dfd65e 100644 --- a/src/ngLocale/angular-locale_ar-qa.js +++ b/src/ngLocale/angular-locale_ar-qa.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-sa.js b/src/ngLocale/angular-locale_ar-sa.js index 1b880d9a..8ee44d42 100644 --- a/src/ngLocale/angular-locale_ar-sa.js +++ b/src/ngLocale/angular-locale_ar-sa.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-sd.js b/src/ngLocale/angular-locale_ar-sd.js index c78fdff2..0141e057 100644 --- a/src/ngLocale/angular-locale_ar-sd.js +++ b/src/ngLocale/angular-locale_ar-sd.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-sy.js b/src/ngLocale/angular-locale_ar-sy.js index 41e364a8..cb324e87 100644 --- a/src/ngLocale/angular-locale_ar-sy.js +++ b/src/ngLocale/angular-locale_ar-sy.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-tn.js b/src/ngLocale/angular-locale_ar-tn.js index fc4a8b0e..a78f0de6 100644 --- a/src/ngLocale/angular-locale_ar-tn.js +++ b/src/ngLocale/angular-locale_ar-tn.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar-ye.js b/src/ngLocale/angular-locale_ar-ye.js index f5dc74e5..6b28d2ff 100644 --- a/src/ngLocale/angular-locale_ar-ye.js +++ b/src/ngLocale/angular-locale_ar-ye.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ar.js b/src/ngLocale/angular-locale_ar.js index 300498f0..872194e7 100644 --- a/src/ngLocale/angular-locale_ar.js +++ b/src/ngLocale/angular-locale_ar.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_bg-bg.js b/src/ngLocale/angular-locale_bg-bg.js index b33dc471..c88bb884 100644 --- a/src/ngLocale/angular-locale_bg-bg.js +++ b/src/ngLocale/angular-locale_bg-bg.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_bg.js b/src/ngLocale/angular-locale_bg.js index 7d8a253b..db0865b0 100644 --- a/src/ngLocale/angular-locale_bg.js +++ b/src/ngLocale/angular-locale_bg.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_bn-bd.js b/src/ngLocale/angular-locale_bn-bd.js index c16bdda2..980495ce 100644 --- a/src/ngLocale/angular-locale_bn-bd.js +++ b/src/ngLocale/angular-locale_bn-bd.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_bn-in.js b/src/ngLocale/angular-locale_bn-in.js index 0014314c..0b414286 100644 --- a/src/ngLocale/angular-locale_bn-in.js +++ b/src/ngLocale/angular-locale_bn-in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_bn.js b/src/ngLocale/angular-locale_bn.js index 82fbe385..5cc14cc6 100644 --- a/src/ngLocale/angular-locale_bn.js +++ b/src/ngLocale/angular-locale_bn.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ca-ad.js b/src/ngLocale/angular-locale_ca-ad.js index f1cdab21..a7f1e6ea 100644 --- a/src/ngLocale/angular-locale_ca-ad.js +++ b/src/ngLocale/angular-locale_ca-ad.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ca-es.js b/src/ngLocale/angular-locale_ca-es.js index 90662edd..b589a21d 100644 --- a/src/ngLocale/angular-locale_ca-es.js +++ b/src/ngLocale/angular-locale_ca-es.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ca.js b/src/ngLocale/angular-locale_ca.js index cf881e0c..3bced031 100644 --- a/src/ngLocale/angular-locale_ca.js +++ b/src/ngLocale/angular-locale_ca.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_cs-cz.js b/src/ngLocale/angular-locale_cs-cz.js index b0c3dfd9..3c88d948 100644 --- a/src/ngLocale/angular-locale_cs-cz.js +++ b/src/ngLocale/angular-locale_cs-cz.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_cs.js b/src/ngLocale/angular-locale_cs.js index fbe92cf1..c0a1e334 100644 --- a/src/ngLocale/angular-locale_cs.js +++ b/src/ngLocale/angular-locale_cs.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_da-dk.js b/src/ngLocale/angular-locale_da-dk.js index 3a7afac9..399a1e4e 100644 --- a/src/ngLocale/angular-locale_da-dk.js +++ b/src/ngLocale/angular-locale_da-dk.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_da.js b/src/ngLocale/angular-locale_da.js index 52c97db0..1d8bcbee 100644 --- a/src/ngLocale/angular-locale_da.js +++ b/src/ngLocale/angular-locale_da.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_de-at.js b/src/ngLocale/angular-locale_de-at.js index 9c7c455c..257e7d81 100644 --- a/src/ngLocale/angular-locale_de-at.js +++ b/src/ngLocale/angular-locale_de-at.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_de-be.js b/src/ngLocale/angular-locale_de-be.js index 63b32dc8..d07143b3 100644 --- a/src/ngLocale/angular-locale_de-be.js +++ b/src/ngLocale/angular-locale_de-be.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_de-ch.js b/src/ngLocale/angular-locale_de-ch.js index 178c463b..b2499395 100644 --- a/src/ngLocale/angular-locale_de-ch.js +++ b/src/ngLocale/angular-locale_de-ch.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_de-de.js b/src/ngLocale/angular-locale_de-de.js index 404715f1..58e70431 100644 --- a/src/ngLocale/angular-locale_de-de.js +++ b/src/ngLocale/angular-locale_de-de.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_de-li.js b/src/ngLocale/angular-locale_de-li.js index 8f3d2d21..28865132 100644 --- a/src/ngLocale/angular-locale_de-li.js +++ b/src/ngLocale/angular-locale_de-li.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_de-lu.js b/src/ngLocale/angular-locale_de-lu.js index 70a75820..61aa489c 100644 --- a/src/ngLocale/angular-locale_de-lu.js +++ b/src/ngLocale/angular-locale_de-lu.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_de.js b/src/ngLocale/angular-locale_de.js index ebb28538..6ea1f221 100644 --- a/src/ngLocale/angular-locale_de.js +++ b/src/ngLocale/angular-locale_de.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_el-cy.js b/src/ngLocale/angular-locale_el-cy.js index 12526870..e7a4c94e 100644 --- a/src/ngLocale/angular-locale_el-cy.js +++ b/src/ngLocale/angular-locale_el-cy.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_el-gr.js b/src/ngLocale/angular-locale_el-gr.js index a6c045ab..101464f8 100644 --- a/src/ngLocale/angular-locale_el-gr.js +++ b/src/ngLocale/angular-locale_el-gr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_el.js b/src/ngLocale/angular-locale_el.js index cdecf742..84330501 100644 --- a/src/ngLocale/angular-locale_el.js +++ b/src/ngLocale/angular-locale_el.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-as.js b/src/ngLocale/angular-locale_en-as.js index d1cab808..3cc5eb54 100644 --- a/src/ngLocale/angular-locale_en-as.js +++ b/src/ngLocale/angular-locale_en-as.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-au.js b/src/ngLocale/angular-locale_en-au.js index a0de72b9..c09f4ae7 100644 --- a/src/ngLocale/angular-locale_en-au.js +++ b/src/ngLocale/angular-locale_en-au.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-bb.js b/src/ngLocale/angular-locale_en-bb.js index 91ee7ff9..dcf93adb 100644 --- a/src/ngLocale/angular-locale_en-bb.js +++ b/src/ngLocale/angular-locale_en-bb.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-be.js b/src/ngLocale/angular-locale_en-be.js index 7ec6b29d..673beb5e 100644 --- a/src/ngLocale/angular-locale_en-be.js +++ b/src/ngLocale/angular-locale_en-be.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-bm.js b/src/ngLocale/angular-locale_en-bm.js index 49f670e3..604db153 100644 --- a/src/ngLocale/angular-locale_en-bm.js +++ b/src/ngLocale/angular-locale_en-bm.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-bw.js b/src/ngLocale/angular-locale_en-bw.js index c7d9855f..0aeb9f98 100644 --- a/src/ngLocale/angular-locale_en-bw.js +++ b/src/ngLocale/angular-locale_en-bw.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-bz.js b/src/ngLocale/angular-locale_en-bz.js index e40b2d51..17f242dc 100644 --- a/src/ngLocale/angular-locale_en-bz.js +++ b/src/ngLocale/angular-locale_en-bz.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-ca.js b/src/ngLocale/angular-locale_en-ca.js index cd137fb7..37090357 100644 --- a/src/ngLocale/angular-locale_en-ca.js +++ b/src/ngLocale/angular-locale_en-ca.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-dsrt-us.js b/src/ngLocale/angular-locale_en-dsrt-us.js index 52e9f968..0ede3159 100644 --- a/src/ngLocale/angular-locale_en-dsrt-us.js +++ b/src/ngLocale/angular-locale_en-dsrt-us.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-dsrt.js b/src/ngLocale/angular-locale_en-dsrt.js index 24618aa5..5e86ec53 100644 --- a/src/ngLocale/angular-locale_en-dsrt.js +++ b/src/ngLocale/angular-locale_en-dsrt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-fm.js b/src/ngLocale/angular-locale_en-fm.js index 565d04cf..525604fc 100644 --- a/src/ngLocale/angular-locale_en-fm.js +++ b/src/ngLocale/angular-locale_en-fm.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-gb.js b/src/ngLocale/angular-locale_en-gb.js index f97e342a..4a0f59ac 100644 --- a/src/ngLocale/angular-locale_en-gb.js +++ b/src/ngLocale/angular-locale_en-gb.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-gu.js b/src/ngLocale/angular-locale_en-gu.js index 06f5a86f..994b5716 100644 --- a/src/ngLocale/angular-locale_en-gu.js +++ b/src/ngLocale/angular-locale_en-gu.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-gy.js b/src/ngLocale/angular-locale_en-gy.js index b4acc072..0c524052 100644 --- a/src/ngLocale/angular-locale_en-gy.js +++ b/src/ngLocale/angular-locale_en-gy.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-hk.js b/src/ngLocale/angular-locale_en-hk.js index 4c2c8d33..261c4906 100644 --- a/src/ngLocale/angular-locale_en-hk.js +++ b/src/ngLocale/angular-locale_en-hk.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-ie.js b/src/ngLocale/angular-locale_en-ie.js index dc559f7b..a7d7b757 100644 --- a/src/ngLocale/angular-locale_en-ie.js +++ b/src/ngLocale/angular-locale_en-ie.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-in.js b/src/ngLocale/angular-locale_en-in.js index 6be8b880..ad058896 100644 --- a/src/ngLocale/angular-locale_en-in.js +++ b/src/ngLocale/angular-locale_en-in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-iso.js b/src/ngLocale/angular-locale_en-iso.js index 23500ed0..158f8de0 100644 --- a/src/ngLocale/angular-locale_en-iso.js +++ b/src/ngLocale/angular-locale_en-iso.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-jm.js b/src/ngLocale/angular-locale_en-jm.js index 6845afe9..7aebeab8 100644 --- a/src/ngLocale/angular-locale_en-jm.js +++ b/src/ngLocale/angular-locale_en-jm.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-mh.js b/src/ngLocale/angular-locale_en-mh.js index 91ca2646..08544436 100644 --- a/src/ngLocale/angular-locale_en-mh.js +++ b/src/ngLocale/angular-locale_en-mh.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-mp.js b/src/ngLocale/angular-locale_en-mp.js index e3d0d058..c05f5c9b 100644 --- a/src/ngLocale/angular-locale_en-mp.js +++ b/src/ngLocale/angular-locale_en-mp.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-mt.js b/src/ngLocale/angular-locale_en-mt.js index 0c87da0f..822d0ace 100644 --- a/src/ngLocale/angular-locale_en-mt.js +++ b/src/ngLocale/angular-locale_en-mt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-mu.js b/src/ngLocale/angular-locale_en-mu.js index 50352c65..13629d6b 100644 --- a/src/ngLocale/angular-locale_en-mu.js +++ b/src/ngLocale/angular-locale_en-mu.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-na.js b/src/ngLocale/angular-locale_en-na.js index 1bf61fef..779fb026 100644 --- a/src/ngLocale/angular-locale_en-na.js +++ b/src/ngLocale/angular-locale_en-na.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-nz.js b/src/ngLocale/angular-locale_en-nz.js index 50858e0c..8e010734 100644 --- a/src/ngLocale/angular-locale_en-nz.js +++ b/src/ngLocale/angular-locale_en-nz.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-ph.js b/src/ngLocale/angular-locale_en-ph.js index f1e74111..647b9e10 100644 --- a/src/ngLocale/angular-locale_en-ph.js +++ b/src/ngLocale/angular-locale_en-ph.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-pk.js b/src/ngLocale/angular-locale_en-pk.js index 46411ec5..bc586489 100644 --- a/src/ngLocale/angular-locale_en-pk.js +++ b/src/ngLocale/angular-locale_en-pk.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-pr.js b/src/ngLocale/angular-locale_en-pr.js index de5ed1f3..6d66c083 100644 --- a/src/ngLocale/angular-locale_en-pr.js +++ b/src/ngLocale/angular-locale_en-pr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-pw.js b/src/ngLocale/angular-locale_en-pw.js index 4f1e259a..e280faa9 100644 --- a/src/ngLocale/angular-locale_en-pw.js +++ b/src/ngLocale/angular-locale_en-pw.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-sg.js b/src/ngLocale/angular-locale_en-sg.js index 8e26c89a..ccffcd8f 100644 --- a/src/ngLocale/angular-locale_en-sg.js +++ b/src/ngLocale/angular-locale_en-sg.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-tc.js b/src/ngLocale/angular-locale_en-tc.js index 38757ed5..f9fdf66c 100644 --- a/src/ngLocale/angular-locale_en-tc.js +++ b/src/ngLocale/angular-locale_en-tc.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-tt.js b/src/ngLocale/angular-locale_en-tt.js index bdfbc0e4..32effe2b 100644 --- a/src/ngLocale/angular-locale_en-tt.js +++ b/src/ngLocale/angular-locale_en-tt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-um.js b/src/ngLocale/angular-locale_en-um.js index 295795a2..aaba7a3e 100644 --- a/src/ngLocale/angular-locale_en-um.js +++ b/src/ngLocale/angular-locale_en-um.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-us.js b/src/ngLocale/angular-locale_en-us.js index e5e8a6d9..953cd104 100644 --- a/src/ngLocale/angular-locale_en-us.js +++ b/src/ngLocale/angular-locale_en-us.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-vg.js b/src/ngLocale/angular-locale_en-vg.js index 8dda3450..7f05c153 100644 --- a/src/ngLocale/angular-locale_en-vg.js +++ b/src/ngLocale/angular-locale_en-vg.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-vi.js b/src/ngLocale/angular-locale_en-vi.js index d5b778bc..ea7a1666 100644 --- a/src/ngLocale/angular-locale_en-vi.js +++ b/src/ngLocale/angular-locale_en-vi.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-za.js b/src/ngLocale/angular-locale_en-za.js index a3db4c3b..28969703 100644 --- a/src/ngLocale/angular-locale_en-za.js +++ b/src/ngLocale/angular-locale_en-za.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en-zw.js b/src/ngLocale/angular-locale_en-zw.js index 4aabe4fa..162da1e7 100644 --- a/src/ngLocale/angular-locale_en-zw.js +++ b/src/ngLocale/angular-locale_en-zw.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_en.js b/src/ngLocale/angular-locale_en.js index 60fb4276..ae07737c 100644 --- a/src/ngLocale/angular-locale_en.js +++ b/src/ngLocale/angular-locale_en.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-419.js b/src/ngLocale/angular-locale_es-419.js index 10d94b33..91efc789 100644 --- a/src/ngLocale/angular-locale_es-419.js +++ b/src/ngLocale/angular-locale_es-419.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-ar.js b/src/ngLocale/angular-locale_es-ar.js index 7b489a94..409a3601 100644 --- a/src/ngLocale/angular-locale_es-ar.js +++ b/src/ngLocale/angular-locale_es-ar.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-bo.js b/src/ngLocale/angular-locale_es-bo.js index 62af2676..fce7a392 100644 --- a/src/ngLocale/angular-locale_es-bo.js +++ b/src/ngLocale/angular-locale_es-bo.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-cl.js b/src/ngLocale/angular-locale_es-cl.js index 4521eea8..094dc297 100644 --- a/src/ngLocale/angular-locale_es-cl.js +++ b/src/ngLocale/angular-locale_es-cl.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-co.js b/src/ngLocale/angular-locale_es-co.js index be6f56c1..28bcf76d 100644 --- a/src/ngLocale/angular-locale_es-co.js +++ b/src/ngLocale/angular-locale_es-co.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-cr.js b/src/ngLocale/angular-locale_es-cr.js index 809701bc..321ed8bb 100644 --- a/src/ngLocale/angular-locale_es-cr.js +++ b/src/ngLocale/angular-locale_es-cr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-do.js b/src/ngLocale/angular-locale_es-do.js index b672a85d..48f5014b 100644 --- a/src/ngLocale/angular-locale_es-do.js +++ b/src/ngLocale/angular-locale_es-do.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-ea.js b/src/ngLocale/angular-locale_es-ea.js index e2f9da2b..39d0ea71 100644 --- a/src/ngLocale/angular-locale_es-ea.js +++ b/src/ngLocale/angular-locale_es-ea.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-ec.js b/src/ngLocale/angular-locale_es-ec.js index ba7a370f..cc6eb76e 100644 --- a/src/ngLocale/angular-locale_es-ec.js +++ b/src/ngLocale/angular-locale_es-ec.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-es.js b/src/ngLocale/angular-locale_es-es.js index 99c972ea..a72164f7 100644 --- a/src/ngLocale/angular-locale_es-es.js +++ b/src/ngLocale/angular-locale_es-es.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-gq.js b/src/ngLocale/angular-locale_es-gq.js index 837379e6..c7bab0e6 100644 --- a/src/ngLocale/angular-locale_es-gq.js +++ b/src/ngLocale/angular-locale_es-gq.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-gt.js b/src/ngLocale/angular-locale_es-gt.js index f6cc8cf4..c6d10789 100644 --- a/src/ngLocale/angular-locale_es-gt.js +++ b/src/ngLocale/angular-locale_es-gt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-hn.js b/src/ngLocale/angular-locale_es-hn.js index d314fcdf..9b9023a4 100644 --- a/src/ngLocale/angular-locale_es-hn.js +++ b/src/ngLocale/angular-locale_es-hn.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-ic.js b/src/ngLocale/angular-locale_es-ic.js index bf691562..0f2bfa1a 100644 --- a/src/ngLocale/angular-locale_es-ic.js +++ b/src/ngLocale/angular-locale_es-ic.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-mx.js b/src/ngLocale/angular-locale_es-mx.js index 6991c527..7eb40877 100644 --- a/src/ngLocale/angular-locale_es-mx.js +++ b/src/ngLocale/angular-locale_es-mx.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-ni.js b/src/ngLocale/angular-locale_es-ni.js index 9be77dfa..a93b7012 100644 --- a/src/ngLocale/angular-locale_es-ni.js +++ b/src/ngLocale/angular-locale_es-ni.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-pa.js b/src/ngLocale/angular-locale_es-pa.js index 64a4c176..8496553b 100644 --- a/src/ngLocale/angular-locale_es-pa.js +++ b/src/ngLocale/angular-locale_es-pa.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-pe.js b/src/ngLocale/angular-locale_es-pe.js index 174e4212..b88b21f9 100644 --- a/src/ngLocale/angular-locale_es-pe.js +++ b/src/ngLocale/angular-locale_es-pe.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-pr.js b/src/ngLocale/angular-locale_es-pr.js index e8762092..2917c36a 100644 --- a/src/ngLocale/angular-locale_es-pr.js +++ b/src/ngLocale/angular-locale_es-pr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-py.js b/src/ngLocale/angular-locale_es-py.js index 691099e9..6253d145 100644 --- a/src/ngLocale/angular-locale_es-py.js +++ b/src/ngLocale/angular-locale_es-py.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-sv.js b/src/ngLocale/angular-locale_es-sv.js index 7bbb8a53..63f07560 100644 --- a/src/ngLocale/angular-locale_es-sv.js +++ b/src/ngLocale/angular-locale_es-sv.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-us.js b/src/ngLocale/angular-locale_es-us.js index 3b7fbce0..c9295957 100644 --- a/src/ngLocale/angular-locale_es-us.js +++ b/src/ngLocale/angular-locale_es-us.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-uy.js b/src/ngLocale/angular-locale_es-uy.js index c304ba83..f656e1a9 100644 --- a/src/ngLocale/angular-locale_es-uy.js +++ b/src/ngLocale/angular-locale_es-uy.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es-ve.js b/src/ngLocale/angular-locale_es-ve.js index 9e467882..66418772 100644 --- a/src/ngLocale/angular-locale_es-ve.js +++ b/src/ngLocale/angular-locale_es-ve.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_es.js b/src/ngLocale/angular-locale_es.js index 95914019..91aba876 100644 --- a/src/ngLocale/angular-locale_es.js +++ b/src/ngLocale/angular-locale_es.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_et-ee.js b/src/ngLocale/angular-locale_et-ee.js index d941b67a..c7639471 100644 --- a/src/ngLocale/angular-locale_et-ee.js +++ b/src/ngLocale/angular-locale_et-ee.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_et.js b/src/ngLocale/angular-locale_et.js index 79ebb3e1..f996bba6 100644 --- a/src/ngLocale/angular-locale_et.js +++ b/src/ngLocale/angular-locale_et.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_eu-es.js b/src/ngLocale/angular-locale_eu-es.js index 0b51823b..d5fe45a1 100644 --- a/src/ngLocale/angular-locale_eu-es.js +++ b/src/ngLocale/angular-locale_eu-es.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_eu.js b/src/ngLocale/angular-locale_eu.js index 72400107..67faf10d 100644 --- a/src/ngLocale/angular-locale_eu.js +++ b/src/ngLocale/angular-locale_eu.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fa-af.js b/src/ngLocale/angular-locale_fa-af.js index 21ec56ee..c96ecde8 100644 --- a/src/ngLocale/angular-locale_fa-af.js +++ b/src/ngLocale/angular-locale_fa-af.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fa-ir.js b/src/ngLocale/angular-locale_fa-ir.js index eaf18ef1..27099d75 100644 --- a/src/ngLocale/angular-locale_fa-ir.js +++ b/src/ngLocale/angular-locale_fa-ir.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fa.js b/src/ngLocale/angular-locale_fa.js index 26770276..c94c6c14 100644 --- a/src/ngLocale/angular-locale_fa.js +++ b/src/ngLocale/angular-locale_fa.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fi-fi.js b/src/ngLocale/angular-locale_fi-fi.js index b33062ff..60c57d6e 100644 --- a/src/ngLocale/angular-locale_fi-fi.js +++ b/src/ngLocale/angular-locale_fi-fi.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fi.js b/src/ngLocale/angular-locale_fi.js index 06a42fde..6570dde9 100644 --- a/src/ngLocale/angular-locale_fi.js +++ b/src/ngLocale/angular-locale_fi.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fil-ph.js b/src/ngLocale/angular-locale_fil-ph.js index 849cedea..8873e5aa 100644 --- a/src/ngLocale/angular-locale_fil-ph.js +++ b/src/ngLocale/angular-locale_fil-ph.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fil.js b/src/ngLocale/angular-locale_fil.js index c9cb7ca9..893e7684 100644 --- a/src/ngLocale/angular-locale_fil.js +++ b/src/ngLocale/angular-locale_fil.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-be.js b/src/ngLocale/angular-locale_fr-be.js index ca7d3acc..7de5ef7d 100644 --- a/src/ngLocale/angular-locale_fr-be.js +++ b/src/ngLocale/angular-locale_fr-be.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-bf.js b/src/ngLocale/angular-locale_fr-bf.js index 6717958a..d1583817 100644 --- a/src/ngLocale/angular-locale_fr-bf.js +++ b/src/ngLocale/angular-locale_fr-bf.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-bi.js b/src/ngLocale/angular-locale_fr-bi.js index dad30c01..8fe87363 100644 --- a/src/ngLocale/angular-locale_fr-bi.js +++ b/src/ngLocale/angular-locale_fr-bi.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-bj.js b/src/ngLocale/angular-locale_fr-bj.js index b16c69a6..d5be5b81 100644 --- a/src/ngLocale/angular-locale_fr-bj.js +++ b/src/ngLocale/angular-locale_fr-bj.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-bl.js b/src/ngLocale/angular-locale_fr-bl.js index a9631680..73abcdd7 100644 --- a/src/ngLocale/angular-locale_fr-bl.js +++ b/src/ngLocale/angular-locale_fr-bl.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-ca.js b/src/ngLocale/angular-locale_fr-ca.js index ff3ef403..04fd552d 100644 --- a/src/ngLocale/angular-locale_fr-ca.js +++ b/src/ngLocale/angular-locale_fr-ca.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-cd.js b/src/ngLocale/angular-locale_fr-cd.js index 7afc9504..996c7f59 100644 --- a/src/ngLocale/angular-locale_fr-cd.js +++ b/src/ngLocale/angular-locale_fr-cd.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-cf.js b/src/ngLocale/angular-locale_fr-cf.js index fe7f1f97..614add52 100644 --- a/src/ngLocale/angular-locale_fr-cf.js +++ b/src/ngLocale/angular-locale_fr-cf.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-cg.js b/src/ngLocale/angular-locale_fr-cg.js index e5360f51..9431c2c9 100644 --- a/src/ngLocale/angular-locale_fr-cg.js +++ b/src/ngLocale/angular-locale_fr-cg.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-ch.js b/src/ngLocale/angular-locale_fr-ch.js index 0257ebd7..6a47fb0c 100644 --- a/src/ngLocale/angular-locale_fr-ch.js +++ b/src/ngLocale/angular-locale_fr-ch.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-ci.js b/src/ngLocale/angular-locale_fr-ci.js index d8d7f9a3..7ba2130e 100644 --- a/src/ngLocale/angular-locale_fr-ci.js +++ b/src/ngLocale/angular-locale_fr-ci.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-cm.js b/src/ngLocale/angular-locale_fr-cm.js index 1026a507..ef8e7ded 100644 --- a/src/ngLocale/angular-locale_fr-cm.js +++ b/src/ngLocale/angular-locale_fr-cm.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-dj.js b/src/ngLocale/angular-locale_fr-dj.js index 2f9cf4c1..052750c4 100644 --- a/src/ngLocale/angular-locale_fr-dj.js +++ b/src/ngLocale/angular-locale_fr-dj.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-fr.js b/src/ngLocale/angular-locale_fr-fr.js index 6a41fc0a..8e38aa01 100644 --- a/src/ngLocale/angular-locale_fr-fr.js +++ b/src/ngLocale/angular-locale_fr-fr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-ga.js b/src/ngLocale/angular-locale_fr-ga.js index 5f444e0e..a732c276 100644 --- a/src/ngLocale/angular-locale_fr-ga.js +++ b/src/ngLocale/angular-locale_fr-ga.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-gf.js b/src/ngLocale/angular-locale_fr-gf.js index 249ff7c9..3ef7c4ae 100644 --- a/src/ngLocale/angular-locale_fr-gf.js +++ b/src/ngLocale/angular-locale_fr-gf.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-gn.js b/src/ngLocale/angular-locale_fr-gn.js index 44786d72..a239cc8e 100644 --- a/src/ngLocale/angular-locale_fr-gn.js +++ b/src/ngLocale/angular-locale_fr-gn.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-gp.js b/src/ngLocale/angular-locale_fr-gp.js index 8c02ea5e..7e00d063 100644 --- a/src/ngLocale/angular-locale_fr-gp.js +++ b/src/ngLocale/angular-locale_fr-gp.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-gq.js b/src/ngLocale/angular-locale_fr-gq.js index 58e6481e..107f5ff3 100644 --- a/src/ngLocale/angular-locale_fr-gq.js +++ b/src/ngLocale/angular-locale_fr-gq.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-km.js b/src/ngLocale/angular-locale_fr-km.js index 03766493..8e17c220 100644 --- a/src/ngLocale/angular-locale_fr-km.js +++ b/src/ngLocale/angular-locale_fr-km.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-lu.js b/src/ngLocale/angular-locale_fr-lu.js index e9aec05e..86f1a7cc 100644 --- a/src/ngLocale/angular-locale_fr-lu.js +++ b/src/ngLocale/angular-locale_fr-lu.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-mc.js b/src/ngLocale/angular-locale_fr-mc.js index db1150e1..3fb2bc8e 100644 --- a/src/ngLocale/angular-locale_fr-mc.js +++ b/src/ngLocale/angular-locale_fr-mc.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-mf.js b/src/ngLocale/angular-locale_fr-mf.js index f6f48c9d..6e35abe9 100644 --- a/src/ngLocale/angular-locale_fr-mf.js +++ b/src/ngLocale/angular-locale_fr-mf.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-mg.js b/src/ngLocale/angular-locale_fr-mg.js index 5706df26..35e8308f 100644 --- a/src/ngLocale/angular-locale_fr-mg.js +++ b/src/ngLocale/angular-locale_fr-mg.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-ml.js b/src/ngLocale/angular-locale_fr-ml.js index 6a8b568e..e2b6d8ad 100644 --- a/src/ngLocale/angular-locale_fr-ml.js +++ b/src/ngLocale/angular-locale_fr-ml.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-mq.js b/src/ngLocale/angular-locale_fr-mq.js index d7d41adf..b99ce2fe 100644 --- a/src/ngLocale/angular-locale_fr-mq.js +++ b/src/ngLocale/angular-locale_fr-mq.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-ne.js b/src/ngLocale/angular-locale_fr-ne.js index ce20c086..2e61a66d 100644 --- a/src/ngLocale/angular-locale_fr-ne.js +++ b/src/ngLocale/angular-locale_fr-ne.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-re.js b/src/ngLocale/angular-locale_fr-re.js index 442f6905..5cb611ba 100644 --- a/src/ngLocale/angular-locale_fr-re.js +++ b/src/ngLocale/angular-locale_fr-re.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr-yt.js b/src/ngLocale/angular-locale_fr-yt.js index 22240bb0..eb648536 100644 --- a/src/ngLocale/angular-locale_fr-yt.js +++ b/src/ngLocale/angular-locale_fr-yt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_fr.js b/src/ngLocale/angular-locale_fr.js index 6f3a4bcc..b45cdc2b 100644 --- a/src/ngLocale/angular-locale_fr.js +++ b/src/ngLocale/angular-locale_fr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_gl-es.js b/src/ngLocale/angular-locale_gl-es.js index bf456cea..f9dc6282 100644 --- a/src/ngLocale/angular-locale_gl-es.js +++ b/src/ngLocale/angular-locale_gl-es.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_gl.js b/src/ngLocale/angular-locale_gl.js index a9535295..b5f47b4a 100644 --- a/src/ngLocale/angular-locale_gl.js +++ b/src/ngLocale/angular-locale_gl.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_gsw-ch.js b/src/ngLocale/angular-locale_gsw-ch.js index c013912d..759974d8 100644 --- a/src/ngLocale/angular-locale_gsw-ch.js +++ b/src/ngLocale/angular-locale_gsw-ch.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_gsw.js b/src/ngLocale/angular-locale_gsw.js index 553602c9..08247560 100644 --- a/src/ngLocale/angular-locale_gsw.js +++ b/src/ngLocale/angular-locale_gsw.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_gu-in.js b/src/ngLocale/angular-locale_gu-in.js index a82bfe90..d661a684 100644 --- a/src/ngLocale/angular-locale_gu-in.js +++ b/src/ngLocale/angular-locale_gu-in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_gu.js b/src/ngLocale/angular-locale_gu.js index 864cc5da..c8045115 100644 --- a/src/ngLocale/angular-locale_gu.js +++ b/src/ngLocale/angular-locale_gu.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_he-il.js b/src/ngLocale/angular-locale_he-il.js index cd59f549..bc99779e 100644 --- a/src/ngLocale/angular-locale_he-il.js +++ b/src/ngLocale/angular-locale_he-il.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_he.js b/src/ngLocale/angular-locale_he.js index 23d1cbce..88ae35a3 100644 --- a/src/ngLocale/angular-locale_he.js +++ b/src/ngLocale/angular-locale_he.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_hi-in.js b/src/ngLocale/angular-locale_hi-in.js index d9b00291..17399a35 100644 --- a/src/ngLocale/angular-locale_hi-in.js +++ b/src/ngLocale/angular-locale_hi-in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_hi.js b/src/ngLocale/angular-locale_hi.js index c9258b8c..165c639e 100644 --- a/src/ngLocale/angular-locale_hi.js +++ b/src/ngLocale/angular-locale_hi.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_hr-hr.js b/src/ngLocale/angular-locale_hr-hr.js index 865d7567..3ef9ff30 100644 --- a/src/ngLocale/angular-locale_hr-hr.js +++ b/src/ngLocale/angular-locale_hr-hr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_hr.js b/src/ngLocale/angular-locale_hr.js index ed4223e4..6702e6b5 100644 --- a/src/ngLocale/angular-locale_hr.js +++ b/src/ngLocale/angular-locale_hr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_hu-hu.js b/src/ngLocale/angular-locale_hu-hu.js index ae33eb0a..8a7f1267 100644 --- a/src/ngLocale/angular-locale_hu-hu.js +++ b/src/ngLocale/angular-locale_hu-hu.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_hu.js b/src/ngLocale/angular-locale_hu.js index beb16198..26558ed2 100644 --- a/src/ngLocale/angular-locale_hu.js +++ b/src/ngLocale/angular-locale_hu.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_id-id.js b/src/ngLocale/angular-locale_id-id.js index 5d028311..b63dd77b 100644 --- a/src/ngLocale/angular-locale_id-id.js +++ b/src/ngLocale/angular-locale_id-id.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_id.js b/src/ngLocale/angular-locale_id.js index a5aa3fca..b17ce79c 100644 --- a/src/ngLocale/angular-locale_id.js +++ b/src/ngLocale/angular-locale_id.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_in.js b/src/ngLocale/angular-locale_in.js index 5eed1c1d..c83cce1f 100644 --- a/src/ngLocale/angular-locale_in.js +++ b/src/ngLocale/angular-locale_in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_is-is.js b/src/ngLocale/angular-locale_is-is.js index e6f8cbbb..fe251424 100644 --- a/src/ngLocale/angular-locale_is-is.js +++ b/src/ngLocale/angular-locale_is-is.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_is.js b/src/ngLocale/angular-locale_is.js index ea64147e..a579b0e5 100644 --- a/src/ngLocale/angular-locale_is.js +++ b/src/ngLocale/angular-locale_is.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_it-it.js b/src/ngLocale/angular-locale_it-it.js index a4997378..82766cc5 100644 --- a/src/ngLocale/angular-locale_it-it.js +++ b/src/ngLocale/angular-locale_it-it.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_it-sm.js b/src/ngLocale/angular-locale_it-sm.js index f431a93b..6a7041dd 100644 --- a/src/ngLocale/angular-locale_it-sm.js +++ b/src/ngLocale/angular-locale_it-sm.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_it.js b/src/ngLocale/angular-locale_it.js index 99ca2a7f..c5101dbd 100644 --- a/src/ngLocale/angular-locale_it.js +++ b/src/ngLocale/angular-locale_it.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_iw.js b/src/ngLocale/angular-locale_iw.js index 7f52d3a3..26d452c4 100644 --- a/src/ngLocale/angular-locale_iw.js +++ b/src/ngLocale/angular-locale_iw.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ja-jp.js b/src/ngLocale/angular-locale_ja-jp.js index 2fc7abcd..f63a1b03 100644 --- a/src/ngLocale/angular-locale_ja-jp.js +++ b/src/ngLocale/angular-locale_ja-jp.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ja.js b/src/ngLocale/angular-locale_ja.js index eb39e847..71f2306c 100644 --- a/src/ngLocale/angular-locale_ja.js +++ b/src/ngLocale/angular-locale_ja.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_kn-in.js b/src/ngLocale/angular-locale_kn-in.js index 6f7ea15c..73d66f57 100644 --- a/src/ngLocale/angular-locale_kn-in.js +++ b/src/ngLocale/angular-locale_kn-in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_kn.js b/src/ngLocale/angular-locale_kn.js index 30203574..fa7c9253 100644 --- a/src/ngLocale/angular-locale_kn.js +++ b/src/ngLocale/angular-locale_kn.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ko-kr.js b/src/ngLocale/angular-locale_ko-kr.js index 91b39e41..8de6031b 100644 --- a/src/ngLocale/angular-locale_ko-kr.js +++ b/src/ngLocale/angular-locale_ko-kr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ko.js b/src/ngLocale/angular-locale_ko.js index b5a4b1bf..51efdc55 100644 --- a/src/ngLocale/angular-locale_ko.js +++ b/src/ngLocale/angular-locale_ko.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ln-cd.js b/src/ngLocale/angular-locale_ln-cd.js index b3470e0b..51a45ed0 100644 --- a/src/ngLocale/angular-locale_ln-cd.js +++ b/src/ngLocale/angular-locale_ln-cd.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ln.js b/src/ngLocale/angular-locale_ln.js index 9881dad9..0f2bb5f5 100644 --- a/src/ngLocale/angular-locale_ln.js +++ b/src/ngLocale/angular-locale_ln.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_lt-lt.js b/src/ngLocale/angular-locale_lt-lt.js index 6a6f81f1..0b84931a 100644 --- a/src/ngLocale/angular-locale_lt-lt.js +++ b/src/ngLocale/angular-locale_lt-lt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_lt.js b/src/ngLocale/angular-locale_lt.js index fd752647..c0d3c0a1 100644 --- a/src/ngLocale/angular-locale_lt.js +++ b/src/ngLocale/angular-locale_lt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_lv-lv.js b/src/ngLocale/angular-locale_lv-lv.js index 4808617a..4bcfced6 100644 --- a/src/ngLocale/angular-locale_lv-lv.js +++ b/src/ngLocale/angular-locale_lv-lv.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_lv.js b/src/ngLocale/angular-locale_lv.js index 45bdcc6d..56ec0492 100644 --- a/src/ngLocale/angular-locale_lv.js +++ b/src/ngLocale/angular-locale_lv.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ml-in.js b/src/ngLocale/angular-locale_ml-in.js index 044005c1..24641e2a 100644 --- a/src/ngLocale/angular-locale_ml-in.js +++ b/src/ngLocale/angular-locale_ml-in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ml.js b/src/ngLocale/angular-locale_ml.js index 20074489..2b61d307 100644 --- a/src/ngLocale/angular-locale_ml.js +++ b/src/ngLocale/angular-locale_ml.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_mr-in.js b/src/ngLocale/angular-locale_mr-in.js index f08286e4..8d5381ae 100644 --- a/src/ngLocale/angular-locale_mr-in.js +++ b/src/ngLocale/angular-locale_mr-in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_mr.js b/src/ngLocale/angular-locale_mr.js index 71d6f792..d9d91ba8 100644 --- a/src/ngLocale/angular-locale_mr.js +++ b/src/ngLocale/angular-locale_mr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ms-my.js b/src/ngLocale/angular-locale_ms-my.js index ade60360..6f91161e 100644 --- a/src/ngLocale/angular-locale_ms-my.js +++ b/src/ngLocale/angular-locale_ms-my.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ms.js b/src/ngLocale/angular-locale_ms.js index 52871840..4acdbffd 100644 --- a/src/ngLocale/angular-locale_ms.js +++ b/src/ngLocale/angular-locale_ms.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_mt-mt.js b/src/ngLocale/angular-locale_mt-mt.js index cc400482..9ccf8b2e 100644 --- a/src/ngLocale/angular-locale_mt-mt.js +++ b/src/ngLocale/angular-locale_mt-mt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_mt.js b/src/ngLocale/angular-locale_mt.js index 9ba583ec..753d21c3 100644 --- a/src/ngLocale/angular-locale_mt.js +++ b/src/ngLocale/angular-locale_mt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_nl-cw.js b/src/ngLocale/angular-locale_nl-cw.js index f98fcf5f..c3351b32 100644 --- a/src/ngLocale/angular-locale_nl-cw.js +++ b/src/ngLocale/angular-locale_nl-cw.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_nl-nl.js b/src/ngLocale/angular-locale_nl-nl.js index f24c149d..3a3e9321 100644 --- a/src/ngLocale/angular-locale_nl-nl.js +++ b/src/ngLocale/angular-locale_nl-nl.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_nl-sx.js b/src/ngLocale/angular-locale_nl-sx.js index 616653cb..a4eda9c2 100644 --- a/src/ngLocale/angular-locale_nl-sx.js +++ b/src/ngLocale/angular-locale_nl-sx.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_nl.js b/src/ngLocale/angular-locale_nl.js index e5cbbd1f..955948cf 100644 --- a/src/ngLocale/angular-locale_nl.js +++ b/src/ngLocale/angular-locale_nl.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_no.js b/src/ngLocale/angular-locale_no.js index 07e3a790..313e260b 100644 --- a/src/ngLocale/angular-locale_no.js +++ b/src/ngLocale/angular-locale_no.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_or-in.js b/src/ngLocale/angular-locale_or-in.js index 6332a2f5..acf991a4 100644 --- a/src/ngLocale/angular-locale_or-in.js +++ b/src/ngLocale/angular-locale_or-in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_or.js b/src/ngLocale/angular-locale_or.js index aab4988f..e169682c 100644 --- a/src/ngLocale/angular-locale_or.js +++ b/src/ngLocale/angular-locale_or.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_pl-pl.js b/src/ngLocale/angular-locale_pl-pl.js index 5b2078aa..23f8678e 100644 --- a/src/ngLocale/angular-locale_pl-pl.js +++ b/src/ngLocale/angular-locale_pl-pl.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_pl.js b/src/ngLocale/angular-locale_pl.js index 28859eaa..c64b34d1 100644 --- a/src/ngLocale/angular-locale_pl.js +++ b/src/ngLocale/angular-locale_pl.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_pt-br.js b/src/ngLocale/angular-locale_pt-br.js index d0e1a9ed..034fe73b 100644 --- a/src/ngLocale/angular-locale_pt-br.js +++ b/src/ngLocale/angular-locale_pt-br.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_pt-pt.js b/src/ngLocale/angular-locale_pt-pt.js index a0726530..75b3192a 100644 --- a/src/ngLocale/angular-locale_pt-pt.js +++ b/src/ngLocale/angular-locale_pt-pt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_pt.js b/src/ngLocale/angular-locale_pt.js index 5a6bbd56..b9be5cc6 100644 --- a/src/ngLocale/angular-locale_pt.js +++ b/src/ngLocale/angular-locale_pt.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ro-ro.js b/src/ngLocale/angular-locale_ro-ro.js index 807f04fc..2f9f8cdf 100644 --- a/src/ngLocale/angular-locale_ro-ro.js +++ b/src/ngLocale/angular-locale_ro-ro.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ro.js b/src/ngLocale/angular-locale_ro.js index 2153d67d..18d08767 100644 --- a/src/ngLocale/angular-locale_ro.js +++ b/src/ngLocale/angular-locale_ro.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ru-ru.js b/src/ngLocale/angular-locale_ru-ru.js index 3a887f7a..e963e936 100644 --- a/src/ngLocale/angular-locale_ru-ru.js +++ b/src/ngLocale/angular-locale_ru-ru.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ru.js b/src/ngLocale/angular-locale_ru.js index 8f48e2d3..ac00c613 100644 --- a/src/ngLocale/angular-locale_ru.js +++ b/src/ngLocale/angular-locale_ru.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sk-sk.js b/src/ngLocale/angular-locale_sk-sk.js index 84cb8eea..39b8dff0 100644 --- a/src/ngLocale/angular-locale_sk-sk.js +++ b/src/ngLocale/angular-locale_sk-sk.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sk.js b/src/ngLocale/angular-locale_sk.js index 53faf808..a68e0838 100644 --- a/src/ngLocale/angular-locale_sk.js +++ b/src/ngLocale/angular-locale_sk.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sl-si.js b/src/ngLocale/angular-locale_sl-si.js index 9cc57555..af7e8541 100644 --- a/src/ngLocale/angular-locale_sl-si.js +++ b/src/ngLocale/angular-locale_sl-si.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sl.js b/src/ngLocale/angular-locale_sl.js index ebe8df1a..7d6c02a7 100644 --- a/src/ngLocale/angular-locale_sl.js +++ b/src/ngLocale/angular-locale_sl.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sq-al.js b/src/ngLocale/angular-locale_sq-al.js index fad9546c..2aa93e90 100644 --- a/src/ngLocale/angular-locale_sq-al.js +++ b/src/ngLocale/angular-locale_sq-al.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sq.js b/src/ngLocale/angular-locale_sq.js index 1bf529ad..0603e11a 100644 --- a/src/ngLocale/angular-locale_sq.js +++ b/src/ngLocale/angular-locale_sq.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sr-cyrl-rs.js b/src/ngLocale/angular-locale_sr-cyrl-rs.js index 5879f7da..d6b68dd3 100644 --- a/src/ngLocale/angular-locale_sr-cyrl-rs.js +++ b/src/ngLocale/angular-locale_sr-cyrl-rs.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sr-latn-rs.js b/src/ngLocale/angular-locale_sr-latn-rs.js index af39666f..30743fdd 100644 --- a/src/ngLocale/angular-locale_sr-latn-rs.js +++ b/src/ngLocale/angular-locale_sr-latn-rs.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sr.js b/src/ngLocale/angular-locale_sr.js index 7c0b6130..795e9ff7 100644 --- a/src/ngLocale/angular-locale_sr.js +++ b/src/ngLocale/angular-locale_sr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sv-se.js b/src/ngLocale/angular-locale_sv-se.js index 79f671c4..4590ed96 100644 --- a/src/ngLocale/angular-locale_sv-se.js +++ b/src/ngLocale/angular-locale_sv-se.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sv.js b/src/ngLocale/angular-locale_sv.js index 64e590b5..b49b764e 100644 --- a/src/ngLocale/angular-locale_sv.js +++ b/src/ngLocale/angular-locale_sv.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sw-tz.js b/src/ngLocale/angular-locale_sw-tz.js index cd572b6f..2bea9c66 100644 --- a/src/ngLocale/angular-locale_sw-tz.js +++ b/src/ngLocale/angular-locale_sw-tz.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_sw.js b/src/ngLocale/angular-locale_sw.js index 72c3abf8..3892f2c7 100644 --- a/src/ngLocale/angular-locale_sw.js +++ b/src/ngLocale/angular-locale_sw.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ta-in.js b/src/ngLocale/angular-locale_ta-in.js index 01df8c4a..b4919091 100644 --- a/src/ngLocale/angular-locale_ta-in.js +++ b/src/ngLocale/angular-locale_ta-in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ta.js b/src/ngLocale/angular-locale_ta.js index 8a62663f..338d5f95 100644 --- a/src/ngLocale/angular-locale_ta.js +++ b/src/ngLocale/angular-locale_ta.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_te-in.js b/src/ngLocale/angular-locale_te-in.js index ac797b02..4e3e5dbd 100644 --- a/src/ngLocale/angular-locale_te-in.js +++ b/src/ngLocale/angular-locale_te-in.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_te.js b/src/ngLocale/angular-locale_te.js index eaf45c45..9671277b 100644 --- a/src/ngLocale/angular-locale_te.js +++ b/src/ngLocale/angular-locale_te.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_th-th.js b/src/ngLocale/angular-locale_th-th.js index ddf5525f..0791a422 100644 --- a/src/ngLocale/angular-locale_th-th.js +++ b/src/ngLocale/angular-locale_th-th.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_th.js b/src/ngLocale/angular-locale_th.js index 0d250547..be8efab1 100644 --- a/src/ngLocale/angular-locale_th.js +++ b/src/ngLocale/angular-locale_th.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_tl.js b/src/ngLocale/angular-locale_tl.js index 512b3494..0809c013 100644 --- a/src/ngLocale/angular-locale_tl.js +++ b/src/ngLocale/angular-locale_tl.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_tr-tr.js b/src/ngLocale/angular-locale_tr-tr.js index 5999d612..57d3ca4a 100644 --- a/src/ngLocale/angular-locale_tr-tr.js +++ b/src/ngLocale/angular-locale_tr-tr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_tr.js b/src/ngLocale/angular-locale_tr.js index e0e6bad8..bc36ae2e 100644 --- a/src/ngLocale/angular-locale_tr.js +++ b/src/ngLocale/angular-locale_tr.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_uk-ua.js b/src/ngLocale/angular-locale_uk-ua.js index b90d5f4c..1e01d7c9 100644 --- a/src/ngLocale/angular-locale_uk-ua.js +++ b/src/ngLocale/angular-locale_uk-ua.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_uk.js b/src/ngLocale/angular-locale_uk.js index f1f6b6e0..6b505826 100644 --- a/src/ngLocale/angular-locale_uk.js +++ b/src/ngLocale/angular-locale_uk.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ur-pk.js b/src/ngLocale/angular-locale_ur-pk.js index 956534bd..cd642212 100644 --- a/src/ngLocale/angular-locale_ur-pk.js +++ b/src/ngLocale/angular-locale_ur-pk.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_ur.js b/src/ngLocale/angular-locale_ur.js index 6728dc16..d09bea85 100644 --- a/src/ngLocale/angular-locale_ur.js +++ b/src/ngLocale/angular-locale_ur.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_vi-vn.js b/src/ngLocale/angular-locale_vi-vn.js index b03ab4a2..1f4fa05a 100644 --- a/src/ngLocale/angular-locale_vi-vn.js +++ b/src/ngLocale/angular-locale_vi-vn.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_vi.js b/src/ngLocale/angular-locale_vi.js index 4e1108a2..d8d478e9 100644 --- a/src/ngLocale/angular-locale_vi.js +++ b/src/ngLocale/angular-locale_vi.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_zh-cn.js b/src/ngLocale/angular-locale_zh-cn.js index 8ec6b39c..787d1fd2 100644 --- a/src/ngLocale/angular-locale_zh-cn.js +++ b/src/ngLocale/angular-locale_zh-cn.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_zh-hans-cn.js b/src/ngLocale/angular-locale_zh-hans-cn.js index 094b44a0..b439a080 100644 --- a/src/ngLocale/angular-locale_zh-hans-cn.js +++ b/src/ngLocale/angular-locale_zh-hans-cn.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_zh-hk.js b/src/ngLocale/angular-locale_zh-hk.js index b9e97735..0a471985 100644 --- a/src/ngLocale/angular-locale_zh-hk.js +++ b/src/ngLocale/angular-locale_zh-hk.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_zh-tw.js b/src/ngLocale/angular-locale_zh-tw.js index 44f5a824..8989021f 100644 --- a/src/ngLocale/angular-locale_zh-tw.js +++ b/src/ngLocale/angular-locale_zh-tw.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_zh.js b/src/ngLocale/angular-locale_zh.js index 779f208e..d02bfa32 100644 --- a/src/ngLocale/angular-locale_zh.js +++ b/src/ngLocale/angular-locale_zh.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_zu-za.js b/src/ngLocale/angular-locale_zu-za.js index 49201c80..4c6cda6c 100644 --- a/src/ngLocale/angular-locale_zu-za.js +++ b/src/ngLocale/angular-locale_zu-za.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngLocale/angular-locale_zu.js b/src/ngLocale/angular-locale_zu.js index a657987b..fcadc8f7 100644 --- a/src/ngLocale/angular-locale_zu.js +++ b/src/ngLocale/angular-locale_zu.js @@ -1,3 +1,4 @@ +'use strict';  angular.module("ngLocale", [], ["$provide", function($provide) {  var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};  $provide.value("$locale", { diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js index 81124916..703fbe34 100644 --- a/src/ngMock/angular-mocks.js +++ b/src/ngMock/angular-mocks.js @@ -1,3 +1,5 @@ +'use strict'; +  /**   * @license AngularJS v"NG_VERSION_FULL"   * (c) 2010-2012 Google, Inc. http://angularjs.org @@ -117,7 +119,7 @@ angular.mock.$Browser = function() {        if (self.deferredFns.length) {          self.defer.now = self.deferredFns[self.deferredFns.length-1].time;        } else { -        throw Error('No deferred tasks to be flushed'); +        throw new Error('No deferred tasks to be flushed');        }      } @@ -162,7 +164,7 @@ angular.mock.$Browser.prototype = {    cookies:  function(name, value) {      if (name) { -      if (value == undefined) { +      if (angular.isUndefined(value)) {          delete this.cookieHash[name];        } else {          if (angular.isString(value) &&       //strings only @@ -190,8 +192,8 @@ angular.mock.$Browser.prototype = {   * @name ngMock.$exceptionHandlerProvider   *   * @description - * Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors passed - * into the `$exceptionHandler`. + * Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors + * passed into the `$exceptionHandler`.   */  /** @@ -244,10 +246,10 @@ angular.mock.$ExceptionHandlerProvider = function() {     *   - `rethrow`: If any errors are passed into the handler in tests, it typically     *                means that there is a bug in the application or test, so this mock will     *                make these tests fail. -   *   - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` mode stores an -   *            array of errors in `$exceptionHandler.errors`, to allow later assertion of them. -   *            See {@link ngMock.$log#assertEmpty assertEmpty()} and -   *             {@link ngMock.$log#reset reset()} +   *   - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` +   *            mode stores an array of errors in `$exceptionHandler.errors`, to allow later +   *            assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and +   *            {@link ngMock.$log#reset reset()}     */    this.mode = function(mode) {      switch(mode) { @@ -270,7 +272,7 @@ angular.mock.$ExceptionHandlerProvider = function() {          handler.errors = errors;          break;        default: -        throw Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!"); +        throw new Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!");      }    }; @@ -300,12 +302,12 @@ angular.mock.$LogProvider = function() {    }    this.debugEnabled = function(flag) { -	  if (angular.isDefined(flag)) { -		  debug = flag; -		  return this; -	  } else { -		  return debug; -	  } +    if (angular.isDefined(flag)) { +      debug = flag; +      return this; +    } else { +      return debug; +    }    };    this.$get = function () { @@ -404,7 +406,7 @@ angular.mock.$LogProvider = function() {         * var first = $log.debug.logs.unshift();         * </pre>         */ -      $log.debug.logs = [] +      $log.debug.logs = [];      };      /** @@ -413,20 +415,22 @@ angular.mock.$LogProvider = function() {       * @methodOf ngMock.$log       *       * @description -     * Assert that the all of the logging methods have no logged messages. If messages present, an exception is thrown. +     * Assert that the all of the logging methods have no logged messages. If messages present, an +     * exception is thrown.       */      $log.assertEmpty = function() {        var errors = [];        angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) {          angular.forEach($log[logLevel].logs, function(log) {            angular.forEach(log, function (logItem) { -            errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' + (logItem.stack || '')); +            errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' + +                        (logItem.stack || ''));            });          });        });        if (errors.length) { -        errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or an expected " + -          "log message was not checked and removed:"); +        errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or "+ +          "an expected log message was not checked and removed:");          errors.push('');          throw new Error(errors.join('\n---------\n'));        } @@ -467,10 +471,10 @@ angular.mock.$IntervalProvider = function() {      var $interval = function(fn, delay, count, invokeApply) {        var deferred = $q.defer(),            promise = deferred.promise, -          count = (angular.isDefined(count)) ? count : 0,            iteration = 0,            skipApply = (angular.isDefined(invokeApply) && !invokeApply); +      count = (angular.isDefined(count)) ? count : 0,        promise.then(null, null, fn);        promise.$$intervalId = nextRepeatId; @@ -492,7 +496,7 @@ angular.mock.$IntervalProvider = function() {          }          if (!skipApply) $rootScope.$apply(); -      }; +      }        repeatFns.push({          nextTime:(now + delay), @@ -551,9 +555,14 @@ angular.mock.$IntervalProvider = function() {  }; +/* jshint -W101 */ +/* The R_ISO8061_STR regex is never going to fit into the 100 char limit! + * This directive should go inside the anonymous function but a bug in JSHint means that it would + * not be enacted early enough to prevent the warning. + */  (function() {    var R_ISO8061_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/; - +      function jsonStringToDate(string) {      var match;      if (match = string.match(R_ISO8061_STR)) { @@ -565,7 +574,10 @@ angular.mock.$IntervalProvider = function() {          tzMin = int(match[9] + match[11]);        }        date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3])); -      date.setUTCHours(int(match[4]||0) - tzHour, int(match[5]||0) - tzMin, int(match[6]||0), int(match[7]||0)); +      date.setUTCHours(int(match[4]||0) - tzHour, +                       int(match[5]||0) - tzMin, +                       int(match[6]||0), +                       int(match[7]||0));        return date;      }      return string; @@ -728,8 +740,8 @@ angular.mock.$IntervalProvider = function() {                padNumber(self.origDate.getUTCHours(), 2) + ':' +                padNumber(self.origDate.getUTCMinutes(), 2) + ':' +                padNumber(self.origDate.getUTCSeconds(), 2) + '.' + -              padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z' -      } +              padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z'; +      };      }      //hide all methods not implemented in this mock that the Date prototype exposes @@ -742,7 +754,7 @@ angular.mock.$IntervalProvider = function() {      angular.forEach(unimplementedMethods, function(methodName) {        self[methodName] = function() { -        throw Error("Method '" + methodName + "' is not implemented in the TzDate mock"); +        throw new Error("Method '" + methodName + "' is not implemented in the TzDate mock");        };      }); @@ -752,6 +764,7 @@ angular.mock.$IntervalProvider = function() {    //make "tzDateInstance instanceof Date" return true    angular.mock.TzDate.prototype = Date.prototype;  })(); +/* jshint +W101 */  angular.mock.animate = angular.module('mock.animate', ['ng']) @@ -798,9 +811,11 @@ angular.mock.animate = angular.module('mock.animate', ['ng'])   *   * *NOTE*: this is not an injectable instance, just a globally available function.   * - * Method for serializing common angular objects (scope, elements, etc..) into strings, useful for debugging. + * Method for serializing common angular objects (scope, elements, etc..) into strings, useful for + * debugging.   * - * This method is also available on window, where it can be used to display objects on debug console. + * This method is also available on window, where it can be used to display objects on debug + * console.   *   * @param {*} object - any object to turn into string.   * @return {string} a serialized string of the argument @@ -830,7 +845,8 @@ angular.mock.dump = function(object) {        } else if (object instanceof Error) {          out = object.stack || ('' + object.name + ': ' + object.message);        } else { -        // TODO(i): this prevents methods to be logged, we should have a better way to serialize objects +        // TODO(i): this prevents methods being logged, +        // we should have a better way to serialize objects          out = angular.toJson(object, true);        }      } else { @@ -1129,7 +1145,8 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {        if (!expectation.matchHeaders(headers))          throw new Error('Expected ' + expectation + ' with different headers\n' + -            'EXPECTED: ' + prettyPrint(expectation.headers) + '\nGOT:      ' + prettyPrint(headers)); +                        'EXPECTED: ' + prettyPrint(expectation.headers) + '\nGOT:      ' + +                        prettyPrint(headers));        expectations.shift(); @@ -1148,7 +1165,7 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {            ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));          } else if (definition.passThrough) {            $delegate(method, url, data, callback, headers, timeout, withCredentials); -        } else throw Error('No response defined !'); +        } else throw new Error('No response defined !');          return;        }      } @@ -1171,10 +1188,11 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {     *   data string and returns true if the data is as expected.     * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header     *   object and returns true if the headers match the current definition. -   * @returns {requestHandler} Returns an object with `respond` method that control how a matched +   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched     *   request is handled.     * -   *  - respond – `{function([status,] data[, headers])|function(function(method, url, data, headers)}` +   *  - respond –  +   *      `{function([status,] data[, headers])|function(function(method, url, data, headers)}`     *    – The respond method takes a set of static data to be returned or a function that can return     *    an array containing response status (number), response data (string) and response headers     *    (Object). @@ -1297,7 +1315,8 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {     * @returns {requestHandler} Returns an object with `respond` method that control how a matched     *  request is handled.     * -   *  - respond – `{function([status,] data[, headers])|function(function(method, url, data, headers)}` +   *  - respond – +   *    `{function([status,] data[, headers])|function(function(method, url, data, headers)}`     *    – The respond method takes a set of static data to be returned or a function that can return     *    an array containing response status (number), response data (string) and response headers     *    (Object). @@ -1427,11 +1446,11 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {     */    $httpBackend.flush = function(count) {      $rootScope.$digest(); -    if (!responses.length) throw Error('No pending request to flush !'); +    if (!responses.length) throw new Error('No pending request to flush !');      if (angular.isDefined(count)) {        while (count--) { -        if (!responses.length) throw Error('No more pending request to flush !'); +        if (!responses.length) throw new Error('No more pending request to flush !');          responses.shift()();        }      } else { @@ -1482,7 +1501,7 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {     */    $httpBackend.verifyNoOutstandingRequest = function() {      if (responses.length) { -      throw Error('Unflushed requests: ' + responses.length); +      throw new Error('Unflushed requests: ' + responses.length);      }    }; @@ -1507,14 +1526,14 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {    function createShortMethods(prefix) {      angular.forEach(['GET', 'DELETE', 'JSONP'], function(method) {       $httpBackend[prefix + method] = function(url, headers) { -       return $httpBackend[prefix](method, url, undefined, headers) -     } +       return $httpBackend[prefix](method, url, undefined, headers); +     };      });      angular.forEach(['PUT', 'POST', 'PATCH'], function(method) {        $httpBackend[prefix + method] = function(url, data, headers) { -        return $httpBackend[prefix](method, url, data, headers) -      } +        return $httpBackend[prefix](method, url, data, headers); +      };      });    }  } @@ -1579,7 +1598,8 @@ function MockXhr() {    };    this.getResponseHeader = function(name) { -    // the lookup must be case insensitive, that's why we try two quick lookups and full scan at last +    // the lookup must be case insensitive, +    // that's why we try two quick lookups first and full scan last      var header = this.$$respHeaders[name];      if (header) return header; @@ -1640,7 +1660,8 @@ angular.mock.$TimeoutDecorator = function($delegate, $browser) {     *     * Flushes the next timeout in the queue and compares it to the provided delay     * -   * @param {number=} expectedDelay the delay value that will be asserted against the delay of the next timeout function +   * @param {number=} expectedDelay the delay value that will be asserted against the delay of the +   *                  next timeout function     */    $delegate.flushNext = function(expectedDelay) {      $browser.defer.flushNext(expectedDelay); @@ -1679,7 +1700,7 @@ angular.mock.$TimeoutDecorator = function($delegate, $browser) {  angular.mock.$RootElementProvider = function() {    this.$get = function() {      return angular.element('<div ng-app></div>'); -  } +  };  };  /** @@ -1687,8 +1708,8 @@ angular.mock.$RootElementProvider = function() {   * @name ngMock   * @description   * - * The `ngMock` is an angular module which is used with `ng` module and adds unit-test configuration as well as useful - * mocks to the {@link AUTO.$injector $injector}. + * The `ngMock` is an angular module which is used with `ng` module and adds unit-test configuration + * as well as useful mocks to the {@link AUTO.$injector $injector}.   */  angular.module('ngMock', ['ng']).provider({    $browser: angular.mock.$BrowserProvider, @@ -1777,7 +1798,8 @@ angular.module('ngMockE2E', ['ng']).config(function($provide) {   * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that   *   control how a matched request is handled.   * - *  - respond – `{function([status,] data[, headers])|function(function(method, url, data, headers)}` + *  - respond – + *    `{function([status,] data[, headers])|function(function(method, url, data, headers)}`   *    – The respond method takes a set of static data to be returned or a function that can return   *    an array containing response status (number), response data (string) and response headers   *    (Object). @@ -1879,7 +1901,8 @@ angular.module('ngMockE2E', ['ng']).config(function($provide) {   *   control how a matched request is handled.   */  angular.mock.e2e = {}; -angular.mock.e2e.$httpBackendDecorator = ['$rootScope', '$delegate', '$browser', createHttpBackendMock]; +angular.mock.e2e.$httpBackendDecorator = +  ['$rootScope', '$delegate', '$browser', createHttpBackendMock];  angular.mock.clearDataCache = function() { @@ -1961,7 +1984,7 @@ angular.mock.clearDataCache = function() {      /////////////////////      function workFn() {        if (currentSpec.$injector) { -        throw Error('Injector already created, can not register a module!'); +        throw new Error('Injector already created, can not register a module!');        } else {          var modules = currentSpec.$modules || (currentSpec.$modules = []);          angular.forEach(moduleFns, function(module) { @@ -2079,7 +2102,9 @@ angular.mock.clearDataCache = function() {        }        for(var i = 0, ii = blockFns.length; i < ii; i++) {          try { +          /* jshint -W040 *//* Jasmine explicitly provides a `this` object when calling functions */            injector.invoke(blockFns[i] || angular.noop, this); +          /* jshint +W040 */          } catch (e) {            if(e.stack && errorForStack) e.stack +=  '\n' + errorForStack.stack;            throw e; diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 504ea2c2..3b23bbb9 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -66,21 +66,23 @@ var $resourceMinErr = angular.$$minErr('$resource');   *   *   Where:   * - *   - **`action`** – {string} – The name of action. This name becomes the name of the method on your - *     resource object. - *   - **`method`** – {string} – HTTP request method. Valid methods are: `GET`, `POST`, `PUT`, `DELETE`, - *     and `JSONP`. - *   - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of the - *     parameter value is a function, it will be executed every time when a param value needs to be - *     obtained for a request (unless the param was overridden). - *   - **`url`** – {string} – action specific `url` override. The url templating is supported just like - *     for the resource-level urls. - *   - **`isArray`** – {boolean=} – If true then the returned object for this action is an array, see - *     `returns` section. - *   - **`transformRequest`** – `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` – + *   - **`action`** – {string} – The name of action. This name becomes the name of the method on + *     your resource object. + *   - **`method`** – {string} – HTTP request method. Valid methods are: `GET`, `POST`, `PUT`, + *     `DELETE`, and `JSONP`. + *   - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of + *     the parameter value is a function, it will be executed every time when a param value needs to + *     be obtained for a request (unless the param was overridden). + *   - **`url`** – {string} – action specific `url` override. The url templating is supported just + *     like for the resource-level urls. + *   - **`isArray`** – {boolean=} – If true then the returned object for this action is an array, + *     see `returns` section. + *   - **`transformRequest`** – + *     `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –   *     transform function or an array of such functions. The transform function takes the http   *     request body and headers and returns its transformed (typically serialized) version. - *   - **`transformResponse`** – `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` – + *   - **`transformResponse`** – + *     `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –   *     transform function or an array of such functions. The transform function takes the http   *     response body and headers and returns its transformed (typically deserialized) version.   *   - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the @@ -148,14 +150,15 @@ var $resourceMinErr = angular.$$minErr('$resource');   *   *     On success, the promise is resolved with the same resource instance or collection object,   *     updated with data from server. This makes it easy to use in - *     {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view rendering - *     until the resource(s) are loaded. + *     {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view + *     rendering until the resource(s) are loaded.   * - *     On failure, the promise is resolved with the {@link ng.$http http response} object, - *     without the `resource` property. + *     On failure, the promise is resolved with the {@link ng.$http http response} object, without + *     the `resource` property.   * - *   - `$resolved`: `true` after first server interaction is completed (either with success or rejection), - *     `false` before that. Knowing if the Resource has been resolved is useful in data-binding. + *   - `$resolved`: `true` after first server interaction is completed (either with success or + *      rejection), `false` before that. Knowing if the Resource has been resolved is useful in + *      data-binding.   *   * @example   * @@ -199,7 +202,8 @@ var $resourceMinErr = angular.$$minErr('$resource');   * The object returned from this function execution is a resource "class" which has "static" method   * for each action in the definition.   * - * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and `headers`. + * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and + * `headers`.   * When the data is returned from the server then the object is an instance of the resource type and   * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD   * operations (create, read, update, delete) on server-side data. @@ -231,48 +235,52 @@ var $resourceMinErr = angular.$$minErr('$resource');     Let's look at what a buzz client created with the `$resource` service looks like:      <doc:example> -      <doc:source jsfiddle="false"> -       <script> -         function BuzzController($resource) { -           this.userId = 'googlebuzz'; -           this.Activity = $resource( -             'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments', -             {alt:'json', callback:'JSON_CALLBACK'}, -             {get:{method:'JSONP', params:{visibility:'@self'}}, replies: {method:'JSONP', params:{visibility:'@self', comments:'@comments'}}} -           ); +    <doc:source jsfiddle="false"> +    <script> +     function BuzzController($resource) { +       this.userId = 'googlebuzz'; +       this.Activity = $resource( +         'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments', +         {alt:'json', callback:'JSON_CALLBACK'}, +         { +           get:{method:'JSONP', params:{visibility:'@self'}}, +           replies: {method:'JSONP', params:{visibility:'@self', comments:'@comments'}}           } - -         BuzzController.prototype = { -           fetch: function() { -             this.activities = this.Activity.get({userId:this.userId}); -           }, -           expandReplies: function(activity) { -             activity.replies = this.Activity.replies({userId:this.userId, activityId:activity.id}); -           } -         }; -         BuzzController.$inject = ['$resource']; -       </script> - -       <div ng-controller="BuzzController"> -         <input ng-model="userId"/> -         <button ng-click="fetch()">fetch</button> -         <hr/> -         <div ng-repeat="item in activities.data.items"> -           <h1 style="font-size: 15px;"> -             <img src="{{item.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/> -             <a href="{{item.actor.profileUrl}}">{{item.actor.name}}</a> -             <a href ng-click="expandReplies(item)" style="float: right;">Expand replies: {{item.links.replies[0].count}}</a> -           </h1> -           {{item.object.content | html}} -           <div ng-repeat="reply in item.replies.data.items" style="margin-left: 20px;"> -             <img src="{{reply.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/> -             <a href="{{reply.actor.profileUrl}}">{{reply.actor.name}}</a>: {{reply.content | html}} -           </div> -         </div> +       ); +     } + +     BuzzController.prototype = { +       fetch: function() { +         this.activities = this.Activity.get({userId:this.userId}); +       }, +       expandReplies: function(activity) { +         activity.replies = this.Activity.replies({userId:this.userId, activityId:activity.id}); +       } +     }; +     BuzzController.$inject = ['$resource']; +    </script> + +    <div ng-controller="BuzzController"> +     <input ng-model="userId"/> +     <button ng-click="fetch()">fetch</button> +     <hr/> +     <div ng-repeat="item in activities.data.items"> +       <h1 style="font-size: 15px;"> +         <img src="{{item.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/> +         <a href="{{item.actor.profileUrl}}">{{item.actor.name}}</a> +         <a href ng-click="expandReplies(item)" style="float: right;">Expand replies: +           {{item.links.replies[0].count}}</a> +       </h1> +       {{item.object.content | html}} +       <div ng-repeat="reply in item.replies.data.items" style="margin-left: 20px;"> +         <img src="{{reply.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/> +         <a href="{{reply.actor.profileUrl}}">{{reply.actor.name}}</a>: {{reply.content | html}}         </div> -      </doc:source> -      <doc:scenario> -      </doc:scenario> +     </div> +    </div> +    </doc:source> +    <doc:scenario> +    </doc:scenario>      </doc:example>   */  angular.module('ngResource', ['ng']). @@ -313,9 +321,9 @@ angular.module('ngResource', ['ng']).      /** -     * This method is intended for encoding *key* or *value* parts of query component. We need a custom -     * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be -     * encoded per http://tools.ietf.org/html/rfc3986: +     * This method is intended for encoding *key* or *value* parts of query component. We need a +     * custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't +     * have to be encoded per http://tools.ietf.org/html/rfc3986:       *    query       = *( pchar / "/" / "?" )       *    pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"       *    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~" @@ -350,8 +358,9 @@ angular.module('ngResource', ['ng']).            if (param === 'hasOwnProperty') {              throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");            } -          if (!(new RegExp("^\\d+$").test(param)) && param && (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) { -              urlParams[param] = true; +          if (!(new RegExp("^\\d+$").test(param)) && param && +               (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) { +            urlParams[param] = true;            }          });          url = url.replace(/\\:/g, ':'); @@ -394,7 +403,7 @@ angular.module('ngResource', ['ng']).      }; -    function ResourceFactory(url, paramDefaults, actions) { +    function resourceFactory(url, paramDefaults, actions) {        var route = new Route(url);        actions = extend({}, DEFAULT_ACTIONS, actions); @@ -404,7 +413,8 @@ angular.module('ngResource', ['ng']).          actionParams = extend({}, paramDefaults, actionParams);          forEach(actionParams, function(value, key){            if (isFunction(value)) { value = value(); } -          ids[key] = value && value.charAt && value.charAt(0) == '@' ? getter(data, value.substr(1)) : value; +          ids[key] = value && value.charAt && value.charAt(0) == '@' ? +            getter(data, value.substr(1)) : value;          });          return ids;        } @@ -423,6 +433,7 @@ angular.module('ngResource', ['ng']).          Resource[name] = function(a1, a2, a3, a4) {            var params = {}, data, success, error; +          /* jshint -W086 */ /* (purposefully fall through case statements) */            switch(arguments.length) {            case 4:              error = a4; @@ -454,14 +465,18 @@ angular.module('ngResource', ['ng']).            case 0: break;            default:              throw $resourceMinErr('badargs', -              "Expected up to 4 arguments [params, data, success, error], got {0} arguments", arguments.length); +              "Expected up to 4 arguments [params, data, success, error], got {0} arguments", +              arguments.length);            } +          /* jshint +W086 */ /* (purposefully fall through case statements) */            var isInstanceCall = data instanceof Resource;            var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));            var httpConfig = {}; -          var responseInterceptor = action.interceptor && action.interceptor.response || defaultResponseInterceptor; -          var responseErrorInterceptor = action.interceptor && action.interceptor.responseError || undefined; +          var responseInterceptor = action.interceptor && action.interceptor.response || +                                    defaultResponseInterceptor; +          var responseErrorInterceptor = action.interceptor && action.interceptor.responseError || +                                    undefined;            forEach(action, function(value, key) {              if (key != 'params' && key != 'isArray' && key != 'interceptor') { @@ -470,18 +485,23 @@ angular.module('ngResource', ['ng']).            });            if (hasBody) httpConfig.data = data; -          route.setUrlParams(httpConfig, extend({}, extractParams(data, action.params || {}), params), action.url); +          route.setUrlParams(httpConfig, +                             extend({}, extractParams(data, action.params || {}), params), +                             action.url);            var promise = $http(httpConfig).then(function(response) {              var data = response.data,                  promise = value.$promise;              if (data) { -              if ( angular.isArray(data) != !!action.isArray ) { -                throw $resourceMinErr('badcfg', 'Error in resource configuration. Expected response' + -                  ' to contain an {0} but got an {1}', +              // Need to convert action.isArray to boolean in case it is undefined +              // jshint -W018 +              if ( angular.isArray(data) !== (!!action.isArray) ) { +                throw $resourceMinErr('badcfg', 'Error in resource configuration. Expected ' + +                  'response to contain an {0} but got an {1}',                    action.isArray?'array':'object', angular.isArray(data)?'array':'object');                } +              // jshint +W018                if (action.isArray) {                  value.length = 0;                  forEach(data, function(item) { @@ -539,11 +559,11 @@ angular.module('ngResource', ['ng']).        });        Resource.bind = function(additionalParamDefaults){ -        return ResourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions); +        return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);        };        return Resource;      } -    return ResourceFactory; +    return resourceFactory;    }]); diff --git a/src/ngRoute/directive/ngView.js b/src/ngRoute/directive/ngView.js index 1706e25a..ab1327d0 100644 --- a/src/ngRoute/directive/ngView.js +++ b/src/ngRoute/directive/ngView.js @@ -113,20 +113,21 @@ ngRouteModule.directive('ngView', ngViewFactory);        </file>        <file name="script.js"> -        angular.module('ngViewExample', ['ngRoute', 'ngAnimate'], function($routeProvider, $locationProvider) { -          $routeProvider.when('/Book/:bookId', { -            templateUrl: 'book.html', -            controller: BookCntl, -            controllerAs: 'book' -          }); -          $routeProvider.when('/Book/:bookId/ch/:chapterId', { -            templateUrl: 'chapter.html', -            controller: ChapterCntl, -            controllerAs: 'chapter' -          }); - -          // configure html5 to get links working on jsfiddle -          $locationProvider.html5Mode(true); +        angular.module('ngViewExample', ['ngRoute', 'ngAnimate'], +          function($routeProvider, $locationProvider) { +            $routeProvider.when('/Book/:bookId', { +              templateUrl: 'book.html', +              controller: BookCntl, +              controllerAs: 'book' +            }); +            $routeProvider.when('/Book/:bookId/ch/:chapterId', { +              templateUrl: 'chapter.html', +              controller: ChapterCntl, +              controllerAs: 'chapter' +            }); + +            // configure html5 to get links working on jsfiddle +            $locationProvider.html5Mode(true);          });          function MainCntl($route, $routeParams, $location) { @@ -238,7 +239,7 @@ function ngViewFactory(   $route,   $anchorScroll,   $compile,   $controller,              cleanupLastView();            }          } -      } +      };      }    };  } diff --git a/src/ngRoute/route.js b/src/ngRoute/route.js index 50e2405a..060e2208 100644 --- a/src/ngRoute/route.js +++ b/src/ngRoute/route.js @@ -12,7 +12,7 @@   * {@installModule route}   *   */ - + /* global -ngRouteModule */  var ngRouteModule = angular.module('ngRoute', ['ng']).                          provider('$route', $RouteProvider); @@ -64,9 +64,9 @@ function $RouteProvider(){     *     *    Object properties:     * -   *    - `controller` – `{(string|function()=}` – Controller fn that should be associated with newly -   *      created scope or the name of a {@link angular.Module#controller registered controller} -   *      if passed as a string. +   *    - `controller` – `{(string|function()=}` – Controller fn that should be associated with +   *      newly created scope or the name of a {@link angular.Module#controller registered +   *      controller} if passed as a string.     *    - `controllerAs` – `{string=}` – A controller alias name. If present the controller will be     *      published to scope under the `controllerAs` name.     *    - `template` – `{string=|function()=}` – html template as a string or a function that @@ -95,10 +95,10 @@ function $RouteProvider(){     *      - `key` – `{string}`: a name of a dependency to be injected into the controller.     *      - `factory` - `{string|function}`: If `string` then it is an alias for a service.     *        Otherwise if function, then it is {@link api/AUTO.$injector#invoke injected} -   *        and the return value is treated as the dependency. If the result is a promise, it is resolved -   *        before its value is injected into the controller. Be aware that `ngRoute.$routeParams` will -   *        still refer to the previous route within these resolve functions.  Use `$route.current.params` -   *        to access the new route parameters, instead. +   *        and the return value is treated as the dependency. If the result is a promise, it is +   *        resolved before its value is injected into the controller. Be aware that +   *        `ngRoute.$routeParams` will still refer to the previous route within these resolve +   *        functions.  Use `$route.current.params` to access the new route parameters, instead.     *     *    - `redirectTo` – {(string|function())=} – value to update     *      {@link ng.$location $location} path with and trigger route redirection. @@ -210,8 +210,15 @@ function $RouteProvider(){    }; -  this.$get = ['$rootScope', '$location', '$routeParams', '$q', '$injector', '$http', '$templateCache', '$sce', -      function( $rootScope,   $location,   $routeParams,   $q,   $injector,   $http,   $templateCache,   $sce) { +  this.$get = ['$rootScope', +               '$location', +               '$routeParams', +               '$q', +               '$injector', +               '$http', +               '$templateCache', +               '$sce', +      function($rootScope, $location, $routeParams, $q, $injector, $http, $templateCache, $sce) {      /**       * @ngdoc object @@ -240,8 +247,9 @@ function $RouteProvider(){       *       * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.       * -     * The `$route` service is typically used in conjunction with the {@link ngRoute.directive:ngView `ngView`} -     * directive and the {@link ngRoute.$routeParams `$routeParams`} service. +     * The `$route` service is typically used in conjunction with the +     * {@link ngRoute.directive:ngView `ngView`} directive and the +     * {@link ngRoute.$routeParams `$routeParams`} service.       *       * @example         This example shows how changing the URL hash causes the `$route` to match a route against the @@ -369,7 +377,8 @@ function $RouteProvider(){       *       * @param {Object} angularEvent Synthetic event object.       * @param {Route} current Current route information. -     * @param {Route|Undefined} previous Previous route information, or undefined if current is first route entered. +     * @param {Route|Undefined} previous Previous route information, or undefined if current is +     * first route entered.       */      /** @@ -464,7 +473,8 @@ function $RouteProvider(){            last = $route.current;        if (next && last && next.$$route === last.$$route -          && angular.equals(next.pathParams, last.pathParams) && !next.reloadOnSearch && !forceReload) { +          && angular.equals(next.pathParams, last.pathParams) +          && !next.reloadOnSearch && !forceReload) {          last.params = next.params;          angular.copy(last.params, $routeParams);          $rootScope.$broadcast('$routeUpdate', last); @@ -491,7 +501,8 @@ function $RouteProvider(){                    template, templateUrl;                angular.forEach(locals, function(value, key) { -                locals[key] = angular.isString(value) ? $injector.get(value) : $injector.invoke(value); +                locals[key] = angular.isString(value) ? +                    $injector.get(value) : $injector.invoke(value);                });                if (angular.isDefined(template = next.template)) { diff --git a/src/ngSanitize/filter/linky.js b/src/ngSanitize/filter/linky.js index 282a6117..39494f2d 100644 --- a/src/ngSanitize/filter/linky.js +++ b/src/ngSanitize/filter/linky.js @@ -1,3 +1,7 @@ +'use strict'; + +/* global htmlSanitizeWriter: false */ +  /**   * @ngdoc filter   * @name ngSanitize.filter:linky @@ -97,7 +101,8 @@     </doc:example>   */  angular.module('ngSanitize').filter('linky', function() { -  var LINKY_URL_REGEXP = /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/, +  var LINKY_URL_REGEXP = +        /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>]/,        MAILTO_REGEXP = /^mailto:/;    return function(text, target) { diff --git a/src/ngSanitize/sanitize.js b/src/ngSanitize/sanitize.js index 1d03dd9d..b9381ea2 100644 --- a/src/ngSanitize/sanitize.js +++ b/src/ngSanitize/sanitize.js @@ -50,75 +50,80 @@ var $sanitizeMinErr = angular.$$minErr('$sanitize');   *   * @example     <doc:example module="ngSanitize"> -     <doc:source> -       <script> -         function Ctrl($scope, $sce) { -           $scope.snippet = -             '<p style="color:blue">an html\n' + -             '<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' + -             'snippet</p>'; -           $scope.deliberatelyTrustDangerousSnippet = function() { -             return $sce.trustAsHtml($scope.snippet); -           }; -         } -       </script> -       <div ng-controller="Ctrl"> -          Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea> -           <table> -             <tr> -               <td>Directive</td> -               <td>How</td> -               <td>Source</td> -               <td>Rendered</td> -             </tr> -             <tr id="bind-html-with-sanitize"> -               <td>ng-bind-html</td> -               <td>Automatically uses $sanitize</td> -               <td><pre><div ng-bind-html="snippet"><br/></div></pre></td> -               <td><div ng-bind-html="snippet"></div></td> -             </tr> -             <tr id="bind-html-with-trust"> -               <td>ng-bind-html</td> -               <td>Bypass $sanitize by explicitly trusting the dangerous value</td> -               <td><pre><div ng-bind-html="deliberatelyTrustDangerousSnippet()"><br/></div></pre></td> -               <td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td> -             </tr> -             <tr id="bind-default"> -               <td>ng-bind</td> -               <td>Automatically escapes</td> -               <td><pre><div ng-bind="snippet"><br/></div></pre></td> -               <td><div ng-bind="snippet"></div></td> -             </tr> -           </table> -         </div> -     </doc:source> -     <doc:scenario> -       it('should sanitize the html snippet by default', function() { -         expect(using('#bind-html-with-sanitize').element('div').html()). -           toBe('<p>an html\n<em>click here</em>\nsnippet</p>'); -       }); - -       it('should inline raw snippet if bound to a trusted value', function() { -         expect(using('#bind-html-with-trust').element("div").html()). -           toBe("<p style=\"color:blue\">an html\n" + -                "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + -                "snippet</p>"); -       }); - -       it('should escape snippet without any filter', function() { -         expect(using('#bind-default').element('div').html()). -           toBe("<p style=\"color:blue\">an html\n" + -                "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + -                "snippet</p>"); -       }); - -       it('should update', function() { -         input('snippet').enter('new <b onclick="alert(1)">text</b>'); -         expect(using('#bind-html-with-sanitize').element('div').html()).toBe('new <b>text</b>'); -         expect(using('#bind-html-with-trust').element('div').html()).toBe('new <b onclick="alert(1)">text</b>'); -         expect(using('#bind-default').element('div').html()).toBe("new <b onclick=\"alert(1)\">text</b>"); -       }); -     </doc:scenario> +   <doc:source> +     <script> +       function Ctrl($scope, $sce) { +         $scope.snippet = +           '<p style="color:blue">an html\n' + +           '<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' + +           'snippet</p>'; +         $scope.deliberatelyTrustDangerousSnippet = function() { +           return $sce.trustAsHtml($scope.snippet); +         }; +       } +     </script> +     <div ng-controller="Ctrl"> +        Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea> +       <table> +         <tr> +           <td>Directive</td> +           <td>How</td> +           <td>Source</td> +           <td>Rendered</td> +         </tr> +         <tr id="bind-html-with-sanitize"> +           <td>ng-bind-html</td> +           <td>Automatically uses $sanitize</td> +           <td><pre><div ng-bind-html="snippet"><br/></div></pre></td> +           <td><div ng-bind-html="snippet"></div></td> +         </tr> +         <tr id="bind-html-with-trust"> +           <td>ng-bind-html</td> +           <td>Bypass $sanitize by explicitly trusting the dangerous value</td> +           <td> +           <pre><div ng-bind-html="deliberatelyTrustDangerousSnippet()"> +</div></pre> +           </td> +           <td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td> +         </tr> +         <tr id="bind-default"> +           <td>ng-bind</td> +           <td>Automatically escapes</td> +           <td><pre><div ng-bind="snippet"><br/></div></pre></td> +           <td><div ng-bind="snippet"></div></td> +         </tr> +       </table> +       </div> +   </doc:source> +   <doc:scenario> +     it('should sanitize the html snippet by default', function() { +       expect(using('#bind-html-with-sanitize').element('div').html()). +         toBe('<p>an html\n<em>click here</em>\nsnippet</p>'); +     }); + +     it('should inline raw snippet if bound to a trusted value', function() { +       expect(using('#bind-html-with-trust').element("div").html()). +         toBe("<p style=\"color:blue\">an html\n" + +              "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + +              "snippet</p>"); +     }); + +     it('should escape snippet without any filter', function() { +       expect(using('#bind-default').element('div').html()). +         toBe("<p style=\"color:blue\">an html\n" + +              "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + +              "snippet</p>"); +     }); + +     it('should update', function() { +       input('snippet').enter('new <b onclick="alert(1)">text</b>'); +       expect(using('#bind-html-with-sanitize').element('div').html()).toBe('new <b>text</b>'); +       expect(using('#bind-html-with-trust').element('div').html()).toBe( +         'new <b onclick="alert(1)">text</b>'); +       expect(using('#bind-default').element('div').html()).toBe( +         "new <b onclick=\"alert(1)\">text</b>"); +     }); +   </doc:scenario>     </doc:example>   */  var $sanitize = function(html) { @@ -129,7 +134,8 @@ var $sanitize = function(html) {  // Regular Expressions for parsing tags and attributes -var START_TAG_REGEXP = /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/, +var START_TAG_REGEXP = +       /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,    END_TAG_REGEXP = /^<\s*\/\s*([\w:-]+)[^>]*>/,    ATTR_REGEXP = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,    BEGIN_TAG_REGEXP = /^</, @@ -138,7 +144,8 @@ var START_TAG_REGEXP = /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:    DOCTYPE_REGEXP = /<!DOCTYPE([^>]*?)>/i,    CDATA_REGEXP = /<!\[CDATA\[(.*?)]]>/g,    URI_REGEXP = /^((ftp|https?):\/\/|mailto:|tel:|#)/i, -  NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g; // Match everything outside of normal chars and " (quote character) +  // Match everything outside of normal chars and " (quote character) +  NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g;  // Good source of info about elements and attributes @@ -153,23 +160,29 @@ var voidElements = makeMap("area,br,col,hr,img,wbr");  // http://dev.w3.org/html5/spec/Overview.html#optional-tags  var optionalEndTagBlockElements = makeMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),      optionalEndTagInlineElements = makeMap("rp,rt"), -    optionalEndTagElements = angular.extend({}, optionalEndTagInlineElements, optionalEndTagBlockElements); +    optionalEndTagElements = angular.extend({}, +                                            optionalEndTagInlineElements, +                                            optionalEndTagBlockElements);  // Safe Block Elements - HTML5 -var blockElements = angular.extend({}, optionalEndTagBlockElements, makeMap("address,article,aside," + -        "blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6," + -        "header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")); +var blockElements = angular.extend({}, optionalEndTagBlockElements, makeMap("address,article," + +        "aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5," + +        "h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul"));  // Inline Elements - HTML5 -var inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap("a,abbr,acronym,b,bdi,bdo," + -        "big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small," + -        "span,strike,strong,sub,sup,time,tt,u,var")); +var inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap("a,abbr,acronym,b," + +        "bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s," + +        "samp,small,span,strike,strong,sub,sup,time,tt,u,var"));  // Special Elements (can contain anything)  var specialElements = makeMap("script,style"); -var validElements = angular.extend({}, voidElements, blockElements, inlineElements, optionalEndTagElements); +var validElements = angular.extend({}, +                                   voidElements, +                                   blockElements, +                                   inlineElements, +                                   optionalEndTagElements);  //Attributes that have href and hence need to be sanitized  var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap"); @@ -258,21 +271,21 @@ function htmlParser( html, handler ) {        }      } else { -      html = html.replace(new RegExp("(.*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'), function(all, text){ -        text = text. -          replace(COMMENT_REGEXP, "$1"). -          replace(CDATA_REGEXP, "$1"); +      html = html.replace(new RegExp("(.*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'), +        function(all, text){ +          text = text.replace(COMMENT_REGEXP, "$1").replace(CDATA_REGEXP, "$1"); -        if (handler.chars) handler.chars( decodeEntities(text) ); +          if (handler.chars) handler.chars( decodeEntities(text) ); -        return ""; +          return "";        });        parseEndTag( "", stack.last() );      }      if ( html == last ) { -      throw $sanitizeMinErr('badparse', "The sanitizer was unable to parse the following block of html: {0}", html); +      throw $sanitizeMinErr('badparse', "The sanitizer was unable to parse the following block " + +                                        "of html: {0}", html);      }      last = html;    } @@ -299,13 +312,14 @@ function htmlParser( html, handler ) {      var attrs = {}; -    rest.replace(ATTR_REGEXP, function(match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) { -      var value = doubleQuotedValue -        || singleQuotedValue -        || unquotedValue -        || ''; +    rest.replace(ATTR_REGEXP, +      function(match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) { +        var value = doubleQuotedValue +          || singleQuotedValue +          || unquotedValue +          || ''; -      attrs[name] = decodeEntities(value); +        attrs[name] = decodeEntities(value);      });      if (handler.start) handler.start( tagName, attrs, unary );    } @@ -377,12 +391,12 @@ function htmlSanitizeWriter(buf){        if (!ignore && specialElements[tag]) {          ignore = tag;        } -      if (!ignore && validElements[tag] == true) { +      if (!ignore && validElements[tag] === true) {          out('<');          out(tag);          angular.forEach(attrs, function(value, key){            var lkey=angular.lowercase(key); -          if (validAttrs[lkey]==true && (uriAttrs[lkey]!==true || value.match(URI_REGEXP))) { +          if (validAttrs[lkey]===true && (uriAttrs[lkey]!==true || value.match(URI_REGEXP))) {              out(' ');              out(key);              out('="'); @@ -395,7 +409,7 @@ function htmlSanitizeWriter(buf){      },      end: function(tag){          tag = angular.lowercase(tag); -        if (!ignore && validElements[tag] == true) { +        if (!ignore && validElements[tag] === true) {            out('</');            out(tag);            out('>'); diff --git a/src/ngScenario/ObjectModel.js b/src/ngScenario/ObjectModel.js index 47ee936b..14672080 100644 --- a/src/ngScenario/ObjectModel.js +++ b/src/ngScenario/ObjectModel.js @@ -66,7 +66,7 @@ angular.scenario.ObjectModel = function(runner) {    runner.on('StepBegin', function(spec, step) {      var it = self.getSpec(spec.id); -    var step = new angular.scenario.ObjectModel.Step(step.name); +    step = new angular.scenario.ObjectModel.Step(step.name);      it.steps.push(step);      // forward the event @@ -140,8 +140,9 @@ angular.scenario.ObjectModel.prototype.on = function(eventName, listener) {   */  angular.scenario.ObjectModel.prototype.emit = function(eventName) {    var self = this, -      args = Array.prototype.slice.call(arguments, 1), -      eventName = eventName.toLowerCase(); +      args = Array.prototype.slice.call(arguments, 1); +   +  eventName = eventName.toLowerCase();    if (this.listeners[eventName]) {      angular.forEach(this.listeners[eventName], function(listener) { diff --git a/src/ngScenario/Scenario.js b/src/ngScenario/Scenario.js index dda9a9e3..9a30d8a9 100644 --- a/src/ngScenario/Scenario.js +++ b/src/ngScenario/Scenario.js @@ -39,6 +39,7 @@ angular.scenario.output = angular.scenario.output || function(name, fn) {   */  angular.scenario.dsl = angular.scenario.dsl || function(name, fn) {    angular.scenario.dsl[name] = function() { +    /* jshint -W040 *//* The dsl binds `this` for us when calling chained functions */      function executeStatement(statement, args) {        var result = statement.apply(this, args);        if (angular.isFunction(result) || result instanceof angular.scenario.Future) @@ -270,15 +271,15 @@ _jQuery.fn.bindings = function(windowJquery, bindExp) {        if (actualExp) {          actualExp = actualExp.replace(/\s/g, '');          if (actualExp == bindExp) return true; -        if (actualExp.indexOf(bindExp) == 0) { +        if (actualExp.indexOf(bindExp) === 0) {            return actualExp.charAt(bindExp.length) == '|';          }        } -    } +    };    } else if (bindExp) {      match = function(actualExp) {        return actualExp && bindExp.exec(actualExp); -    } +    };    } else {      match = function(actualExp) {        return !!actualExp; @@ -290,7 +291,7 @@ _jQuery.fn.bindings = function(windowJquery, bindExp) {    }    function push(value) { -    if (value == undefined) { +    if (value === undefined) {        value = '';      } else if (typeof value != 'string') {        value = angular.toJson(value); diff --git a/src/ngScenario/SpecRunner.js b/src/ngScenario/SpecRunner.js index d15912d9..56a92b9a 100644 --- a/src/ngScenario/SpecRunner.js +++ b/src/ngScenario/SpecRunner.js @@ -18,7 +18,8 @@ angular.scenario.SpecRunner = function() {   * based on the describe nesting.   *   * @param {Object} spec A spec object - * @param {function()} specDone function that is called when the spec finishes. Function(error, index) + * @param {function()} specDone function that is called when the spec finishes, + *                              of the form `Function(error, index)`   */  angular.scenario.SpecRunner.prototype.run = function(spec, specDone) {    var self = this; diff --git a/src/ngScenario/angular-bootstrap.js b/src/ngScenario/angular-bootstrap.js index a0012ff7..d765dc66 100644 --- a/src/ngScenario/angular-bootstrap.js +++ b/src/ngScenario/angular-bootstrap.js @@ -1,5 +1,7 @@  'use strict'; +/* jshint -W060 */ /* we really do want to write to the document here */ +  (function(previousOnLoad){    var prefix = (function() {      var filename = /(.*\/)angular-bootstrap.js(#(.*))?/; diff --git a/src/ngScenario/browserTrigger.js b/src/ngScenario/browserTrigger.js index c614218d..f74a04c1 100644 --- a/src/ngScenario/browserTrigger.js +++ b/src/ngScenario/browserTrigger.js @@ -20,8 +20,8 @@     *     * @param {Object} element Either a wrapped jQuery/jqLite node or a DOMElement     * @param {string} eventType Optional event type -   * @param {Object=} eventData An optional object which contains additional event data (such as x,y coordinates, keys, etc...) that -   * are passed into the event when triggered +   * @param {Object=} eventData An optional object which contains additional event data (such as x,y +   * coordinates, keys, etc...) that are passed into the event when triggered     */    window.browserTrigger = function browserTrigger(element, eventType, eventData) {      if (element && !element.nodeName) element = element[0]; @@ -124,8 +124,8 @@          evnt = document.createEvent('MouseEvents');          x = x || 0;          y = y || 0; -        evnt.initMouseEvent(eventType, true, true, window, 0, x, y, x, y, pressed('ctrl'), pressed('alt'), -            pressed('shift'), pressed('meta'), 0, element); +        evnt.initMouseEvent(eventType, true, true, window, 0, x, y, x, y, pressed('ctrl'), +            pressed('alt'), pressed('shift'), pressed('meta'), 0, element);        }        /* we're unable to change the timeStamp value directly so this @@ -155,5 +155,5 @@        return finalProcessDefault;      } -  } +  };  }()); diff --git a/src/ngScenario/dsl.js b/src/ngScenario/dsl.js index a70f9aa8..50d20c95 100644 --- a/src/ngScenario/dsl.js +++ b/src/ngScenario/dsl.js @@ -179,12 +179,13 @@ angular.scenario.dsl('using', function() {   */  angular.scenario.dsl('binding', function() {    return function(name) { -    return this.addFutureAction("select binding '" + name + "'", function($window, $document, done) { -      var values = $document.elements().bindings($window.angular.element, name); -      if (!values.length) { -        return done("Binding selector '" + name + "' did not match."); -      } -      done(null, values[0]); +    return this.addFutureAction("select binding '" + name + "'", +      function($window, $document, done) { +        var values = $document.elements().bindings($window.angular.element, name); +        if (!values.length) { +          return done("Binding selector '" + name + "' did not match."); +        } +        done(null, values[0]);      });    };  }); @@ -201,28 +202,31 @@ angular.scenario.dsl('input', function() {    var supportInputEvent =  'oninput' in document.createElement('div') && msie != 9;    chain.enter = function(value, event) { -    return this.addFutureAction("input '" + this.name + "' enter '" + value + "'", function($window, $document, done) { -      var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input'); -      input.val(value); -      input.trigger(event || (supportInputEvent ? 'input' : 'change')); -      done(); +    return this.addFutureAction("input '" + this.name + "' enter '" + value + "'", +      function($window, $document, done) { +        var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input'); +        input.val(value); +        input.trigger(event || (supportInputEvent ? 'input' : 'change')); +        done();      });    };    chain.check = function() { -    return this.addFutureAction("checkbox '" + this.name + "' toggle", function($window, $document, done) { -      var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':checkbox'); -      input.trigger('click'); -      done(); +    return this.addFutureAction("checkbox '" + this.name + "' toggle", +      function($window, $document, done) { +        var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':checkbox'); +        input.trigger('click'); +        done();      });    };    chain.select = function(value) { -    return this.addFutureAction("radio button '" + this.name + "' toggle '" + value + "'", function($window, $document, done) { -      var input = $document. -        elements('[ng\\:model="$1"][value="$2"]', this.name, value).filter(':radio'); -      input.trigger('click'); -      done(); +    return this.addFutureAction("radio button '" + this.name + "' toggle '" + value + "'", +      function($window, $document, done) { +        var input = $document. +          elements('[ng\\:model="$1"][value="$2"]', this.name, value).filter(':radio'); +        input.trigger('click'); +        done();      });    }; @@ -244,33 +248,37 @@ angular.scenario.dsl('input', function() {   * Usage:   *    repeater('#products table', 'Product List').count() number of rows   *    repeater('#products table', 'Product List').row(1) all bindings in row as an array - *    repeater('#products table', 'Product List').column('product.name') all values across all rows in an array + *    repeater('#products table', 'Product List').column('product.name') all values across all rows + *    in an array   */  angular.scenario.dsl('repeater', function() {    var chain = {};    chain.count = function() { -    return this.addFutureAction("repeater '" + this.label + "' count", function($window, $document, done) { -      try { -        done(null, $document.elements().length); -      } catch (e) { -        done(null, 0); -      } +    return this.addFutureAction("repeater '" + this.label + "' count", +      function($window, $document, done) { +        try { +          done(null, $document.elements().length); +        } catch (e) { +          done(null, 0); +        }      });    };    chain.column = function(binding) { -    return this.addFutureAction("repeater '" + this.label + "' column '" + binding + "'", function($window, $document, done) { -      done(null, $document.elements().bindings($window.angular.element, binding)); +    return this.addFutureAction("repeater '" + this.label + "' column '" + binding + "'", +      function($window, $document, done) { +        done(null, $document.elements().bindings($window.angular.element, binding));      });    };    chain.row = function(index) { -    return this.addFutureAction("repeater '" + this.label + "' row '" + index + "'", function($window, $document, done) { -      var matches = $document.elements().slice(index, index + 1); -      if (!matches.length) -        return done('row ' + index + ' out of bounds'); -      done(null, matches.bindings($window.angular.element)); +    return this.addFutureAction("repeater '" + this.label + "' row '" + index + "'", +      function($window, $document, done) { +        var matches = $document.elements().slice(index, index + 1); +        if (!matches.length) +          return done('row ' + index + ' out of bounds'); +        done(null, matches.bindings($window.angular.element));      });    }; @@ -289,36 +297,38 @@ angular.scenario.dsl('select', function() {    var chain = {};    chain.option = function(value) { -    return this.addFutureAction("select '" + this.name + "' option '" + value + "'", function($window, $document, done) { -      var select = $document.elements('select[ng\\:model="$1"]', this.name); -      var option = select.find('option[value="' + value + '"]'); -      if (option.length) { -        select.val(value); -      } else { -        option = select.find('option').filter(function(){ -          return _jQuery(this).text() === value; -        }); -        if (!option.length) { -          option = select.find('option:contains("' + value + '")'); -        } +    return this.addFutureAction("select '" + this.name + "' option '" + value + "'", +      function($window, $document, done) { +        var select = $document.elements('select[ng\\:model="$1"]', this.name); +        var option = select.find('option[value="' + value + '"]');          if (option.length) { -          select.val(option.val()); +          select.val(value);          } else { -            return done("option '" + value + "' not found"); +          option = select.find('option').filter(function(){ +            return _jQuery(this).text() === value; +          }); +          if (!option.length) { +            option = select.find('option:contains("' + value + '")'); +          } +          if (option.length) { +            select.val(option.val()); +          } else { +              return done("option '" + value + "' not found"); +          }          } -      } -      select.trigger('change'); -      done(); +        select.trigger('change'); +        done();      });    };    chain.options = function() {      var values = arguments; -    return this.addFutureAction("select '" + this.name + "' options '" + values + "'", function($window, $document, done) { -      var select = $document.elements('select[multiple][ng\\:model="$1"]', this.name); -      select.val(values); -      select.trigger('change'); -      done(); +    return this.addFutureAction("select '" + this.name + "' options '" + values + "'", +      function($window, $document, done) { +        var select = $document.elements('select[multiple][ng\\:model="$1"]', this.name); +        select.val(values); +        select.trigger('change'); +        done();      });    }; @@ -350,74 +360,81 @@ angular.scenario.dsl('element', function() {    var chain = {};    chain.count = function() { -    return this.addFutureAction("element '" + this.label + "' count", function($window, $document, done) { -      try { -        done(null, $document.elements().length); -      } catch (e) { -        done(null, 0); -      } +    return this.addFutureAction("element '" + this.label + "' count", +      function($window, $document, done) { +        try { +          done(null, $document.elements().length); +        } catch (e) { +          done(null, 0); +        }      });    };    chain.click = function() { -    return this.addFutureAction("element '" + this.label + "' click", function($window, $document, done) { -      var elements = $document.elements(); -      var href = elements.attr('href'); -      var eventProcessDefault = elements.trigger('click')[0]; +    return this.addFutureAction("element '" + this.label + "' click", +      function($window, $document, done) { +        var elements = $document.elements(); +        var href = elements.attr('href'); +        var eventProcessDefault = elements.trigger('click')[0]; -      if (href && elements[0].nodeName.toUpperCase() === 'A' && eventProcessDefault) { -        this.application.navigateTo(href, function() { +        if (href && elements[0].nodeName.toUpperCase() === 'A' && eventProcessDefault) { +          this.application.navigateTo(href, function() { +            done(); +          }, done); +        } else {            done(); -        }, done); -      } else { -        done(); -      } +        }      });    };    chain.dblclick = function() { -    return this.addFutureAction("element '" + this.label + "' dblclick", function($window, $document, done) { -      var elements = $document.elements(); -      var href = elements.attr('href'); -      var eventProcessDefault = elements.trigger('dblclick')[0]; +    return this.addFutureAction("element '" + this.label + "' dblclick", +      function($window, $document, done) { +        var elements = $document.elements(); +        var href = elements.attr('href'); +        var eventProcessDefault = elements.trigger('dblclick')[0]; -      if (href && elements[0].nodeName.toUpperCase() === 'A' && eventProcessDefault) { -        this.application.navigateTo(href, function() { +        if (href && elements[0].nodeName.toUpperCase() === 'A' && eventProcessDefault) { +          this.application.navigateTo(href, function() { +            done(); +          }, done); +        } else {            done(); -        }, done); -      } else { -        done(); -      } +        }      });    };    chain.mouseover = function() { -    return this.addFutureAction("element '" + this.label + "' mouseover", function($window, $document, done) { -      var elements = $document.elements(); -      elements.trigger('mouseover'); -      done(); +    return this.addFutureAction("element '" + this.label + "' mouseover", +      function($window, $document, done) { +        var elements = $document.elements(); +        elements.trigger('mouseover'); +        done();      });    };    chain.mousedown = function() { -      return this.addFutureAction("element '" + this.label + "' mousedown", function($window, $document, done) { -        var elements = $document.elements(); -        elements.trigger('mousedown'); -        done(); +      return this.addFutureAction("element '" + this.label + "' mousedown", +        function($window, $document, done) { +          var elements = $document.elements(); +          elements.trigger('mousedown'); +          done();        });      };    chain.mouseup = function() { -      return this.addFutureAction("element '" + this.label + "' mouseup", function($window, $document, done) { -        var elements = $document.elements(); -        elements.trigger('mouseup'); -        done(); +      return this.addFutureAction("element '" + this.label + "' mouseup", +        function($window, $document, done) { +          var elements = $document.elements(); +          elements.trigger('mouseup'); +          done();        });      };    chain.query = function(fn) { -    return this.addFutureAction('element ' + this.label + ' custom query', function($window, $document, done) { -      fn.call(this, $document.elements(), done); +    return this.addFutureAction('element ' + this.label + ' custom query', +      function($window, $document, done) { +        fn.call(this, $document.elements(), done);      });    }; @@ -426,7 +443,8 @@ angular.scenario.dsl('element', function() {        var args = arguments,            futureName = (args.length == 1)                ? "element '" + this.label + "' get " + methodName + " '" + name + "'" -              : "element '" + this.label + "' set " + methodName + " '" + name + "' to " + "'" + value + "'"; +              : "element '" + this.label + "' set " + methodName + " '" + name + "' to " + "'" + +                value + "'";        return this.addFutureAction(futureName, function($window, $document, done) {          var element = $document.elements(); @@ -438,7 +456,7 @@ angular.scenario.dsl('element', function() {    angular.forEach(VALUE_METHODS, function(methodName) {      chain[methodName] = function(value) {        var args = arguments, -          futureName = (args.length == 0) +          futureName = (args.length === 0)                ? "element '" + this.label + "' " + methodName                : "element '" + this.label + "' set " + methodName + " to '" + value + "'"; diff --git a/src/ngTouch/directive/ngClick.js b/src/ngTouch/directive/ngClick.js index 7dcc4041..10ae3efc 100644 --- a/src/ngTouch/directive/ngClick.js +++ b/src/ngTouch/directive/ngClick.js @@ -1,5 +1,7 @@  'use strict'; +/* global ngTouch: false */ +  /**   * @ngdoc directive   * @name ngTouch.directive:ngClick diff --git a/src/ngTouch/directive/ngSwipe.js b/src/ngTouch/directive/ngSwipe.js index 7a468374..bda37fe9 100644 --- a/src/ngTouch/directive/ngSwipe.js +++ b/src/ngTouch/directive/ngSwipe.js @@ -1,5 +1,7 @@  'use strict'; +/* global ngTouch: false */ +  /**   * @ngdoc directive   * @name ngTouch.directive:ngSwipeLeft @@ -7,7 +9,8 @@   * @description   * Specify custom behavior when an element is swiped to the left on a touchscreen device.   * A leftward swipe is a quick, right-to-left slide of the finger. - * Though ngSwipeLeft is designed for touch-based devices, it will work with a mouse click and drag too. + * Though ngSwipeLeft is designed for touch-based devices, it will work with a mouse click and drag + * too.   *   * Requires the {@link ngTouch `ngTouch`} module to be installed.   * @@ -36,7 +39,8 @@   * @description   * Specify custom behavior when an element is swiped to the right on a touchscreen device.   * A rightward swipe is a quick, left-to-right slide of the finger. - * Though ngSwipeRight is designed for touch-based devices, it will work with a mouse click and drag too. + * Though ngSwipeRight is designed for touch-based devices, it will work with a mouse click and drag + * too.   *   * Requires the {@link ngTouch `ngTouch`} module to be installed.   * diff --git a/src/ngTouch/swipe.js b/src/ngTouch/swipe.js index 4ad58121..afdf4384 100644 --- a/src/ngTouch/swipe.js +++ b/src/ngTouch/swipe.js @@ -1,5 +1,7 @@  'use strict'; +/* global ngTouch: false */ +      /**       * @ngdoc object       * @name ngTouch.$swipe diff --git a/src/ngTouch/touch.js b/src/ngTouch/touch.js index 0e9229b2..e785d82e 100644 --- a/src/ngTouch/touch.js +++ b/src/ngTouch/touch.js @@ -18,5 +18,6 @@   */  // define ngTouch module +/* global -ngTouch */  var ngTouch = angular.module('ngTouch', []); | 
