@@ -9190,7 +9190,7 @@ return jQuery;
9190
9190
}));
9191
9191
9192
9192
/**
9193
- * @license AngularJS v1.3.13
9193
+ * @license AngularJS v1.3.14
9194
9194
* (c) 2010-2014 Google, Inc. http://angularjs.org
9195
9195
* License: MIT
9196
9196
*/
@@ -9246,7 +9246,7 @@ function minErr(module, ErrorConstructor) {
9246
9246
return match;
9247
9247
});
9248
9248
9249
- message = message + '\nhttp://errors.angularjs.org/1.3.13 /' +
9249
+ message = message + '\nhttp://errors.angularjs.org/1.3.14 /' +
9250
9250
(module ? module + '/' : '') + code;
9251
9251
for (i = 2; i < arguments.length; i++) {
9252
9252
message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
@@ -11313,11 +11313,11 @@ function toDebugString(obj) {
11313
11313
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
11314
11314
*/
11315
11315
var version = {
11316
- full: '1.3.13 ', // all of these placeholder strings will be replaced by grunt's
11316
+ full: '1.3.14 ', // all of these placeholder strings will be replaced by grunt's
11317
11317
major: 1, // package task
11318
11318
minor: 3,
11319
- dot: 13 ,
11320
- codeName: 'meticulous-riffleshuffle '
11319
+ dot: 14 ,
11320
+ codeName: 'instantaneous-browserification '
11321
11321
};
11322
11322
11323
11323
@@ -27046,20 +27046,23 @@ var htmlAnchorDirective = valueFn({
27046
27046
*
27047
27047
* @description
27048
27048
*
27049
- * We shouldn't do this, because it will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:
27049
+ * This directive sets the `disabled` attribute on the element if the
27050
+ * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy.
27051
+ *
27052
+ * A special directive is necessary because we cannot use interpolation inside the `disabled`
27053
+ * attribute. The following example would make the button enabled on Chrome/Firefox
27054
+ * but not on older IEs:
27055
+ *
27050
27056
* ```html
27051
- * <div ng-init="scope = { isDisabled: false } ">
27052
- * <button disabled="{{scope. isDisabled}}">Disabled</button>
27057
+ * <div ng-init="isDisabled = false">
27058
+ * <button disabled="{{isDisabled}}">Disabled</button>
27053
27059
* </div>
27054
27060
* ```
27055
27061
*
27056
- * The HTML specification does not require browsers to preserve the values of boolean attributes
27057
- * such as disabled. (Their presence means true and their absence means false.)
27062
+ * This is because the HTML specification does not require browsers to preserve the values of
27063
+ * boolean attributes such as ` disabled` (Their presence means true and their absence means false.)
27058
27064
* If we put an Angular interpolation expression into such an attribute then the
27059
27065
* binding information would be lost when the browser removes the attribute.
27060
- * The `ngDisabled` directive solves this problem for the `disabled` attribute.
27061
- * This complementary directive is not removed by the browser and so provides
27062
- * a permanent reliable place to store the binding information.
27063
27066
*
27064
27067
* @example
27065
27068
<example>
@@ -27078,7 +27081,7 @@ var htmlAnchorDirective = valueFn({
27078
27081
*
27079
27082
* @element INPUT
27080
27083
* @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,
27081
- * then special attribute " disabled" will be set on the element
27084
+ * then the ` disabled` attribute will be set on the element
27082
27085
*/
27083
27086
27084
27087
@@ -29080,7 +29083,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
29080
29083
return value;
29081
29084
});
29082
29085
29083
- if (attr.min || attr.ngMin) {
29086
+ if (isDefined( attr.min) || attr.ngMin) {
29084
29087
var minVal;
29085
29088
ctrl.$validators.min = function(value) {
29086
29089
return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal;
@@ -29096,7 +29099,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
29096
29099
});
29097
29100
}
29098
29101
29099
- if (attr.max || attr.ngMax) {
29102
+ if (isDefined( attr.max) || attr.ngMax) {
29100
29103
var maxVal;
29101
29104
ctrl.$validators.max = function(value) {
29102
29105
return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;
@@ -31902,6 +31905,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
31902
31905
ngModelGet = parsedNgModel,
31903
31906
ngModelSet = parsedNgModelAssign,
31904
31907
pendingDebounce = null,
31908
+ parserValid,
31905
31909
ctrl = this;
31906
31910
31907
31911
this.$$setOptions = function(options) {
@@ -32174,16 +32178,12 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
32174
32178
// the model although neither viewValue nor the model on the scope changed
32175
32179
var modelValue = ctrl.$$rawModelValue;
32176
32180
32177
- // Check if the there's a parse error, so we don't unset it accidentially
32178
- var parserName = ctrl.$$parserName || 'parse';
32179
- var parserValid = ctrl.$error[parserName] ? false : undefined;
32180
-
32181
32181
var prevValid = ctrl.$valid;
32182
32182
var prevModelValue = ctrl.$modelValue;
32183
32183
32184
32184
var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;
32185
32185
32186
- ctrl.$$runValidators(parserValid, modelValue, viewValue, function(allValid) {
32186
+ ctrl.$$runValidators(modelValue, viewValue, function(allValid) {
32187
32187
// If there was no change in validity, don't update the model
32188
32188
// This prevents changing an invalid modelValue to undefined
32189
32189
if (!allowInvalid && prevValid !== allValid) {
@@ -32201,12 +32201,12 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
32201
32201
32202
32202
};
32203
32203
32204
- this.$$runValidators = function(parseValid, modelValue, viewValue, doneCallback) {
32204
+ this.$$runValidators = function(modelValue, viewValue, doneCallback) {
32205
32205
currentValidationRunId++;
32206
32206
var localValidationRunId = currentValidationRunId;
32207
32207
32208
32208
// check parser error
32209
- if (!processParseErrors(parseValid )) {
32209
+ if (!processParseErrors()) {
32210
32210
validationDone(false);
32211
32211
return;
32212
32212
}
@@ -32216,21 +32216,22 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
32216
32216
}
32217
32217
processAsyncValidators();
32218
32218
32219
- function processParseErrors(parseValid ) {
32219
+ function processParseErrors() {
32220
32220
var errorKey = ctrl.$$parserName || 'parse';
32221
- if (parseValid === undefined) {
32221
+ if (parserValid === undefined) {
32222
32222
setValidity(errorKey, null);
32223
32223
} else {
32224
- setValidity(errorKey, parseValid);
32225
- if (!parseValid) {
32224
+ if (!parserValid) {
32226
32225
forEach(ctrl.$validators, function(v, name) {
32227
32226
setValidity(name, null);
32228
32227
});
32229
32228
forEach(ctrl.$asyncValidators, function(v, name) {
32230
32229
setValidity(name, null);
32231
32230
});
32232
- return false;
32233
32231
}
32232
+ // Set the parse error last, to prevent unsetting it, should a $validators key == parserName
32233
+ setValidity(errorKey, parserValid);
32234
+ return parserValid;
32234
32235
}
32235
32236
return true;
32236
32237
}
@@ -32325,7 +32326,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
32325
32326
this.$$parseAndValidate = function() {
32326
32327
var viewValue = ctrl.$$lastCommittedViewValue;
32327
32328
var modelValue = viewValue;
32328
- var parserValid = isUndefined(modelValue) ? undefined : true;
32329
+ parserValid = isUndefined(modelValue) ? undefined : true;
32329
32330
32330
32331
if (parserValid) {
32331
32332
for (var i = 0; i < ctrl.$parsers.length; i++) {
@@ -32351,7 +32352,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
32351
32352
32352
32353
// Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date.
32353
32354
// This can happen if e.g. $setViewValue is called from inside a parser
32354
- ctrl.$$runValidators(parserValid, modelValue, ctrl.$$lastCommittedViewValue, function(allValid) {
32355
+ ctrl.$$runValidators(modelValue, ctrl.$$lastCommittedViewValue, function(allValid) {
32355
32356
if (!allowInvalid) {
32356
32357
// Note: Don't check ctrl.$valid here, as we could have
32357
32358
// external validators (e.g. calculated on the server),
@@ -32472,6 +32473,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
32472
32473
// TODO(perf): why not move this to the action fn?
32473
32474
if (modelValue !== ctrl.$modelValue) {
32474
32475
ctrl.$modelValue = ctrl.$$rawModelValue = modelValue;
32476
+ parserValid = undefined;
32475
32477
32476
32478
var formatters = ctrl.$formatters,
32477
32479
idx = formatters.length;
@@ -32484,7 +32486,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
32484
32486
ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue;
32485
32487
ctrl.$render();
32486
32488
32487
- ctrl.$$runValidators(undefined, modelValue, viewValue, noop);
32489
+ ctrl.$$runValidators(modelValue, viewValue, noop);
32488
32490
}
32489
32491
}
32490
32492
@@ -33300,6 +33302,55 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp
33300
33302
* when keys are deleted and reinstated.
33301
33303
*
33302
33304
*
33305
+ * # Tracking and Duplicates
33306
+ *
33307
+ * When the contents of the collection change, `ngRepeat` makes the corresponding changes to the DOM:
33308
+ *
33309
+ * * When an item is added, a new instance of the template is added to the DOM.
33310
+ * * When an item is removed, its template instance is removed from the DOM.
33311
+ * * When items are reordered, their respective templates are reordered in the DOM.
33312
+ *
33313
+ * By default, `ngRepeat` does not allow duplicate items in arrays. This is because when
33314
+ * there are duplicates, it is not possible to maintain a one-to-one mapping between collection
33315
+ * items and DOM elements.
33316
+ *
33317
+ * If you do need to repeat duplicate items, you can substitute the default tracking behavior
33318
+ * with your own using the `track by` expression.
33319
+ *
33320
+ * For example, you may track items by the index of each item in the collection, using the
33321
+ * special scope property `$index`:
33322
+ * ```html
33323
+ * <div ng-repeat="n in [42, 42, 43, 43] track by $index">
33324
+ * {{n}}
33325
+ * </div>
33326
+ * ```
33327
+ *
33328
+ * You may use arbitrary expressions in `track by`, including references to custom functions
33329
+ * on the scope:
33330
+ * ```html
33331
+ * <div ng-repeat="n in [42, 42, 43, 43] track by myTrackingFunction(n)">
33332
+ * {{n}}
33333
+ * </div>
33334
+ * ```
33335
+ *
33336
+ * If you are working with objects that have an identifier property, you can track
33337
+ * by the identifier instead of the whole object. Should you reload your data later, `ngRepeat`
33338
+ * will not have to rebuild the DOM elements for items it has already rendered, even if the
33339
+ * JavaScript objects in the collection have been substituted for new ones:
33340
+ * ```html
33341
+ * <div ng-repeat="model in collection track by model.id">
33342
+ * {{model.name}}
33343
+ * </div>
33344
+ * ```
33345
+ *
33346
+ * When no `track by` expression is provided, it is equivalent to tracking by the built-in
33347
+ * `$id` function, which tracks items by their identity:
33348
+ * ```html
33349
+ * <div ng-repeat="obj in collection track by $id(obj)">
33350
+ * {{obj.prop}}
33351
+ * </div>
33352
+ * ```
33353
+ *
33303
33354
* # Special repeat start and end points
33304
33355
* To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending
33305
33356
* the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.
@@ -33367,12 +33418,12 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp
33367
33418
*
33368
33419
* For example: `(name, age) in {'adam':10, 'amalie':12}`.
33369
33420
*
33370
- * * `variable in expression track by tracking_expression` – You can also provide an optional tracking function
33371
- * which can be used to associate the objects in the collection with the DOM elements. If no tracking function
33372
- * is specified the ng-repeat associates elements by identity in the collection . It is an error to have
33373
- * more than one tracking function to resolve to the same key. (This would mean that two distinct objects are
33374
- * mapped to the same DOM element, which is not possible.) Filters should be applied to the expression,
33375
- * before specifying a tracking expression.
33421
+ * * `variable in expression track by tracking_expression` – You can also provide an optional tracking expression
33422
+ * which can be used to associate the objects in the collection with the DOM elements. If no tracking expression
33423
+ * is specified, ng-repeat associates elements by identity. It is an error to have
33424
+ * more than one tracking expression value resolve to the same key. (This would mean that two distinct objects are
33425
+ * mapped to the same DOM element, which is not possible.) If filters are used in the expression, they should be
33426
+ * applied before the tracking expression.
33376
33427
*
33377
33428
* For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements
33378
33429
* will be associated by item identity in the array.
0 commit comments