spec/dummy/public/bower_components/angular/angular.js in entangled-0.0.9 vs spec/dummy/public/bower_components/angular/angular.js in entangled-0.0.10

- old
+ new

@@ -1,7 +1,7 @@ /** - * @license AngularJS v1.3.13 + * @license AngularJS v1.3.14 * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ (function(window, document, undefined) {'use strict'; @@ -52,11 +52,11 @@ return toDebugString(templateArgs[index + 2]); } return match; }); - message = message + '\nhttp://errors.angularjs.org/1.3.13/' + + message = message + '\nhttp://errors.angularjs.org/1.3.14/' + (module ? module + '/' : '') + code; for (i = 2; i < arguments.length; i++) { message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' + encodeURIComponent(toDebugString(arguments[i])); } @@ -2119,15 +2119,15 @@ * - `minor` – `{number}` – Minor version number, such as "9". * - `dot` – `{number}` – Dot version number, such as "18". * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". */ var version = { - full: '1.3.13', // all of these placeholder strings will be replaced by grunt's + full: '1.3.14', // all of these placeholder strings will be replaced by grunt's major: 1, // package task minor: 3, - dot: 13, - codeName: 'meticulous-riffleshuffle' + dot: 14, + codeName: 'instantaneous-browserification' }; function publishExternalAPI(angular) { extend(angular, { @@ -17852,24 +17852,27 @@ * @restrict A * @priority 100 * * @description * - * We shouldn't do this, because it will make the button enabled on Chrome/Firefox but not on IE8 and older IEs: + * This directive sets the `disabled` attribute on the element if the + * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy. + * + * A special directive is necessary because we cannot use interpolation inside the `disabled` + * attribute. The following example would make the button enabled on Chrome/Firefox + * but not on older IEs: + * * ```html - * <div ng-init="scope = { isDisabled: false }"> - * <button disabled="{{scope.isDisabled}}">Disabled</button> + * <div ng-init="isDisabled = false"> + * <button disabled="{{isDisabled}}">Disabled</button> * </div> * ``` * - * The HTML specification does not require browsers to preserve the values of boolean attributes - * such as disabled. (Their presence means true and their absence means false.) + * This is because the HTML specification does not require browsers to preserve the values of + * boolean attributes such as `disabled` (Their presence means true and their absence means false.) * If we put an Angular interpolation expression into such an attribute then the * binding information would be lost when the browser removes the attribute. - * The `ngDisabled` directive solves this problem for the `disabled` attribute. - * This complementary directive is not removed by the browser and so provides - * a permanent reliable place to store the binding information. * * @example <example> <file name="index.html"> Click me to toggle: <input type="checkbox" ng-model="checked"><br/> @@ -17884,11 +17887,11 @@ </file> </example> * * @element INPUT * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy, - * then special attribute "disabled" will be set on the element + * then the `disabled` attribute will be set on the element */ /** * @ngdoc directive @@ -19886,11 +19889,11 @@ value = value.toString(); } return value; }); - if (attr.min || attr.ngMin) { + if (isDefined(attr.min) || attr.ngMin) { var minVal; ctrl.$validators.min = function(value) { return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal; }; @@ -19902,11 +19905,11 @@ // TODO(matsko): implement validateLater to reduce number of validations ctrl.$validate(); }); } - if (attr.max || attr.ngMax) { + if (isDefined(attr.max) || attr.ngMax) { var maxVal; ctrl.$validators.max = function(value) { return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal; }; @@ -22708,10 +22711,11 @@ var parsedNgModel = $parse($attr.ngModel), parsedNgModelAssign = parsedNgModel.assign, ngModelGet = parsedNgModel, ngModelSet = parsedNgModelAssign, pendingDebounce = null, + parserValid, ctrl = this; this.$$setOptions = function(options) { ctrl.$options = options; if (options && options.getterSetter) { @@ -22980,20 +22984,16 @@ // set to undefined during a view -> model update that found validation // errors. We can't parse the view here, since that could change // the model although neither viewValue nor the model on the scope changed var modelValue = ctrl.$$rawModelValue; - // Check if the there's a parse error, so we don't unset it accidentially - var parserName = ctrl.$$parserName || 'parse'; - var parserValid = ctrl.$error[parserName] ? false : undefined; - var prevValid = ctrl.$valid; var prevModelValue = ctrl.$modelValue; var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid; - ctrl.$$runValidators(parserValid, modelValue, viewValue, function(allValid) { + ctrl.$$runValidators(modelValue, viewValue, function(allValid) { // If there was no change in validity, don't update the model // This prevents changing an invalid modelValue to undefined if (!allowInvalid && prevValid !== allValid) { // Note: Don't check ctrl.$valid here, as we could have // external validators (e.g. calculated on the server), @@ -23007,40 +23007,41 @@ } }); }; - this.$$runValidators = function(parseValid, modelValue, viewValue, doneCallback) { + this.$$runValidators = function(modelValue, viewValue, doneCallback) { currentValidationRunId++; var localValidationRunId = currentValidationRunId; // check parser error - if (!processParseErrors(parseValid)) { + if (!processParseErrors()) { validationDone(false); return; } if (!processSyncValidators()) { validationDone(false); return; } processAsyncValidators(); - function processParseErrors(parseValid) { + function processParseErrors() { var errorKey = ctrl.$$parserName || 'parse'; - if (parseValid === undefined) { + if (parserValid === undefined) { setValidity(errorKey, null); } else { - setValidity(errorKey, parseValid); - if (!parseValid) { + if (!parserValid) { forEach(ctrl.$validators, function(v, name) { setValidity(name, null); }); forEach(ctrl.$asyncValidators, function(v, name) { setValidity(name, null); }); - return false; } + // Set the parse error last, to prevent unsetting it, should a $validators key == parserName + setValidity(errorKey, parserValid); + return parserValid; } return true; } function processSyncValidators() { @@ -23131,11 +23132,11 @@ }; this.$$parseAndValidate = function() { var viewValue = ctrl.$$lastCommittedViewValue; var modelValue = viewValue; - var parserValid = isUndefined(modelValue) ? undefined : true; + parserValid = isUndefined(modelValue) ? undefined : true; if (parserValid) { for (var i = 0; i < ctrl.$parsers.length; i++) { modelValue = ctrl.$parsers[i](modelValue); if (isUndefined(modelValue)) { @@ -23157,11 +23158,11 @@ writeToModelIfNeeded(); } // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date. // This can happen if e.g. $setViewValue is called from inside a parser - ctrl.$$runValidators(parserValid, modelValue, ctrl.$$lastCommittedViewValue, function(allValid) { + ctrl.$$runValidators(modelValue, ctrl.$$lastCommittedViewValue, function(allValid) { if (!allowInvalid) { // Note: Don't check ctrl.$valid here, as we could have // external validators (e.g. calculated on the server), // that just call $setValidity and need the model value // to calculate their validity. @@ -23278,10 +23279,11 @@ // if scope model value and ngModel value are out of sync // TODO(perf): why not move this to the action fn? if (modelValue !== ctrl.$modelValue) { ctrl.$modelValue = ctrl.$$rawModelValue = modelValue; + parserValid = undefined; var formatters = ctrl.$formatters, idx = formatters.length; var viewValue = modelValue; @@ -23290,11 +23292,11 @@ } if (ctrl.$viewValue !== viewValue) { ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue; ctrl.$render(); - ctrl.$$runValidators(undefined, modelValue, viewValue, noop); + ctrl.$$runValidators(modelValue, viewValue, noop); } } return modelValue; }); @@ -24106,10 +24108,59 @@ * In version 1.4 we will remove the sorting, since it seems that browsers generally follow the * strategy of providing keys in the order in which they were defined, although there are exceptions * when keys are deleted and reinstated. * * + * # Tracking and Duplicates + * + * When the contents of the collection change, `ngRepeat` makes the corresponding changes to the DOM: + * + * * When an item is added, a new instance of the template is added to the DOM. + * * When an item is removed, its template instance is removed from the DOM. + * * When items are reordered, their respective templates are reordered in the DOM. + * + * By default, `ngRepeat` does not allow duplicate items in arrays. This is because when + * there are duplicates, it is not possible to maintain a one-to-one mapping between collection + * items and DOM elements. + * + * If you do need to repeat duplicate items, you can substitute the default tracking behavior + * with your own using the `track by` expression. + * + * For example, you may track items by the index of each item in the collection, using the + * special scope property `$index`: + * ```html + * <div ng-repeat="n in [42, 42, 43, 43] track by $index"> + * {{n}} + * </div> + * ``` + * + * You may use arbitrary expressions in `track by`, including references to custom functions + * on the scope: + * ```html + * <div ng-repeat="n in [42, 42, 43, 43] track by myTrackingFunction(n)"> + * {{n}} + * </div> + * ``` + * + * If you are working with objects that have an identifier property, you can track + * by the identifier instead of the whole object. Should you reload your data later, `ngRepeat` + * will not have to rebuild the DOM elements for items it has already rendered, even if the + * JavaScript objects in the collection have been substituted for new ones: + * ```html + * <div ng-repeat="model in collection track by model.id"> + * {{model.name}} + * </div> + * ``` + * + * When no `track by` expression is provided, it is equivalent to tracking by the built-in + * `$id` function, which tracks items by their identity: + * ```html + * <div ng-repeat="obj in collection track by $id(obj)"> + * {{obj.prop}} + * </div> + * ``` + * * # Special repeat start and end points * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively. * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on) * up to and including the ending HTML tag where **ng-repeat-end** is placed. @@ -24173,15 +24224,15 @@ * * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers, * and `expression` is the scope expression giving the collection to enumerate. * * For example: `(name, age) in {'adam':10, 'amalie':12}`. * - * * `variable in expression track by tracking_expression` – You can also provide an optional tracking function - * which can be used to associate the objects in the collection with the DOM elements. If no tracking function - * is specified the ng-repeat associates elements by identity in the collection. It is an error to have - * more than one tracking function to resolve to the same key. (This would mean that two distinct objects are - * mapped to the same DOM element, which is not possible.) Filters should be applied to the expression, - * before specifying a tracking expression. + * * `variable in expression track by tracking_expression` – You can also provide an optional tracking expression + * which can be used to associate the objects in the collection with the DOM elements. If no tracking expression + * is specified, ng-repeat associates elements by identity. It is an error to have + * more than one tracking expression value resolve to the same key. (This would mean that two distinct objects are + * mapped to the same DOM element, which is not possible.) If filters are used in the expression, they should be + * applied before the tracking expression. * * For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements * will be associated by item identity in the array. * * For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique \ No newline at end of file