angular-gem 1.3.7 → 1.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/angular-gem/version.rb +1 -1
- data/vendor/assets/javascripts/1.3.8/angular-animate.js +2138 -0
- data/vendor/assets/javascripts/1.3.8/angular-aria.js +339 -0
- data/vendor/assets/javascripts/1.3.8/angular-cookies.js +206 -0
- data/vendor/assets/javascripts/1.3.8/angular-loader.js +405 -0
- data/vendor/assets/javascripts/1.3.8/angular-messages.js +400 -0
- data/vendor/assets/javascripts/1.3.8/angular-mocks.js +2382 -0
- data/vendor/assets/javascripts/1.3.8/angular-resource.js +667 -0
- data/vendor/assets/javascripts/1.3.8/angular-route.js +995 -0
- data/vendor/assets/javascripts/1.3.8/angular-sanitize.js +680 -0
- data/vendor/assets/javascripts/1.3.8/angular-scenario.js +37424 -0
- data/vendor/assets/javascripts/1.3.8/angular-touch.js +622 -0
- data/vendor/assets/javascripts/1.3.8/angular.js +26070 -0
- data/vendor/assets/javascripts/angular-animate.js +3 -2
- data/vendor/assets/javascripts/angular-aria.js +20 -13
- data/vendor/assets/javascripts/angular-cookies.js +1 -1
- data/vendor/assets/javascripts/angular-loader.js +2 -2
- data/vendor/assets/javascripts/angular-messages.js +1 -1
- data/vendor/assets/javascripts/angular-mocks.js +15 -15
- data/vendor/assets/javascripts/angular-resource.js +1 -1
- data/vendor/assets/javascripts/angular-route.js +1 -1
- data/vendor/assets/javascripts/angular-sanitize.js +1 -1
- data/vendor/assets/javascripts/angular-scenario.js +95 -62
- data/vendor/assets/javascripts/angular-touch.js +1 -1
- data/vendor/assets/javascripts/angular.js +95 -62
- metadata +14 -2
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.3.
|
2
|
+
* @license AngularJS v1.3.8
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -839,7 +839,8 @@ angular.module('ngAnimate', ['ng'])
|
|
839
839
|
* promise that was returned when the animation was started.
|
840
840
|
*
|
841
841
|
* ```js
|
842
|
-
* var promise = $animate.addClass(element, 'super-long-animation')
|
842
|
+
* var promise = $animate.addClass(element, 'super-long-animation');
|
843
|
+
* promise.then(function() {
|
843
844
|
* //this will still be called even if cancelled
|
844
845
|
* });
|
845
846
|
*
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.3.
|
2
|
+
* @license AngularJS v1.3.8
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -302,21 +302,28 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
|
|
302
302
|
}
|
303
303
|
};
|
304
304
|
})
|
305
|
-
.directive('ngClick',['$aria', function($aria) {
|
305
|
+
.directive('ngClick',['$aria', '$parse', function($aria, $parse) {
|
306
306
|
return {
|
307
307
|
restrict: 'A',
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
308
|
+
compile: function(elem, attr) {
|
309
|
+
var fn = $parse(attr.ngClick, /* interceptorFn */ null, /* expensiveChecks */ true);
|
310
|
+
return function(scope, elem, attr) {
|
311
|
+
if ($aria.config('tabindex') && !elem.attr('tabindex')) {
|
312
|
+
elem.attr('tabindex', 0);
|
313
|
+
}
|
312
314
|
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
315
|
+
if ($aria.config('bindKeypress') && !attr.ngKeypress) {
|
316
|
+
elem.on('keypress', function(event) {
|
317
|
+
if (event.keyCode === 32 || event.keyCode === 13) {
|
318
|
+
scope.$apply(callback);
|
319
|
+
}
|
320
|
+
|
321
|
+
function callback() {
|
322
|
+
fn(scope, { $event: event });
|
323
|
+
}
|
324
|
+
});
|
325
|
+
}
|
326
|
+
};
|
320
327
|
}
|
321
328
|
};
|
322
329
|
}])
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.3.
|
2
|
+
* @license AngularJS v1.3.8
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -55,7 +55,7 @@ function minErr(module, ErrorConstructor) {
|
|
55
55
|
return match;
|
56
56
|
});
|
57
57
|
|
58
|
-
message = message + '\nhttp://errors.angularjs.org/1.3.
|
58
|
+
message = message + '\nhttp://errors.angularjs.org/1.3.8/' +
|
59
59
|
(module ? module + '/' : '') + code;
|
60
60
|
for (i = 2; i < arguments.length; i++) {
|
61
61
|
message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.3.
|
2
|
+
* @license AngularJS v1.3.8
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -1283,7 +1283,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1283
1283
|
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
|
1284
1284
|
* and returns true if the url match the current definition.
|
1285
1285
|
* @param {(Object|function(Object))=} headers HTTP headers.
|
1286
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1286
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1287
1287
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1288
1288
|
* order to change how a matched request is handled.
|
1289
1289
|
*/
|
@@ -1297,7 +1297,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1297
1297
|
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
|
1298
1298
|
* and returns true if the url match the current definition.
|
1299
1299
|
* @param {(Object|function(Object))=} headers HTTP headers.
|
1300
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1300
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1301
1301
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1302
1302
|
* order to change how a matched request is handled.
|
1303
1303
|
*/
|
@@ -1311,7 +1311,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1311
1311
|
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
|
1312
1312
|
* and returns true if the url match the current definition.
|
1313
1313
|
* @param {(Object|function(Object))=} headers HTTP headers.
|
1314
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1314
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1315
1315
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1316
1316
|
* order to change how a matched request is handled.
|
1317
1317
|
*/
|
@@ -1327,7 +1327,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1327
1327
|
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
|
1328
1328
|
* data string and returns true if the data is as expected.
|
1329
1329
|
* @param {(Object|function(Object))=} headers HTTP headers.
|
1330
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1330
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1331
1331
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1332
1332
|
* order to change how a matched request is handled.
|
1333
1333
|
*/
|
@@ -1343,7 +1343,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1343
1343
|
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
|
1344
1344
|
* data string and returns true if the data is as expected.
|
1345
1345
|
* @param {(Object|function(Object))=} headers HTTP headers.
|
1346
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1346
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1347
1347
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1348
1348
|
* order to change how a matched request is handled.
|
1349
1349
|
*/
|
@@ -1356,7 +1356,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1356
1356
|
*
|
1357
1357
|
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
|
1358
1358
|
* and returns true if the url match the current definition.
|
1359
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1359
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1360
1360
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1361
1361
|
* order to change how a matched request is handled.
|
1362
1362
|
*/
|
@@ -1377,7 +1377,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1377
1377
|
* is in JSON format.
|
1378
1378
|
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
|
1379
1379
|
* object and returns true if the headers match the current expectation.
|
1380
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1380
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1381
1381
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1382
1382
|
* order to change how a matched request is handled.
|
1383
1383
|
*
|
@@ -1412,7 +1412,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1412
1412
|
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
|
1413
1413
|
* and returns true if the url match the current definition.
|
1414
1414
|
* @param {Object=} headers HTTP headers.
|
1415
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1415
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1416
1416
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1417
1417
|
* order to change how a matched request is handled. See #expect for more info.
|
1418
1418
|
*/
|
@@ -1426,7 +1426,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1426
1426
|
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
|
1427
1427
|
* and returns true if the url match the current definition.
|
1428
1428
|
* @param {Object=} headers HTTP headers.
|
1429
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1429
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1430
1430
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1431
1431
|
* order to change how a matched request is handled.
|
1432
1432
|
*/
|
@@ -1440,7 +1440,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1440
1440
|
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
|
1441
1441
|
* and returns true if the url match the current definition.
|
1442
1442
|
* @param {Object=} headers HTTP headers.
|
1443
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1443
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1444
1444
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1445
1445
|
* order to change how a matched request is handled.
|
1446
1446
|
*/
|
@@ -1457,7 +1457,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1457
1457
|
* receives data string and returns true if the data is as expected, or Object if request body
|
1458
1458
|
* is in JSON format.
|
1459
1459
|
* @param {Object=} headers HTTP headers.
|
1460
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1460
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1461
1461
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1462
1462
|
* order to change how a matched request is handled.
|
1463
1463
|
*/
|
@@ -1474,7 +1474,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1474
1474
|
* receives data string and returns true if the data is as expected, or Object if request body
|
1475
1475
|
* is in JSON format.
|
1476
1476
|
* @param {Object=} headers HTTP headers.
|
1477
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1477
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1478
1478
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1479
1479
|
* order to change how a matched request is handled.
|
1480
1480
|
*/
|
@@ -1491,7 +1491,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1491
1491
|
* receives data string and returns true if the data is as expected, or Object if request body
|
1492
1492
|
* is in JSON format.
|
1493
1493
|
* @param {Object=} headers HTTP headers.
|
1494
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1494
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1495
1495
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1496
1496
|
* order to change how a matched request is handled.
|
1497
1497
|
*/
|
@@ -1504,7 +1504,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1504
1504
|
*
|
1505
1505
|
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url
|
1506
1506
|
* and returns true if the url match the current definition.
|
1507
|
-
* @returns {requestHandler} Returns an object with `respond` method that
|
1507
|
+
* @returns {requestHandler} Returns an object with `respond` method that controls how a matched
|
1508
1508
|
* request is handled. You can save this object for later use and invoke `respond` again in
|
1509
1509
|
* order to change how a matched request is handled.
|
1510
1510
|
*/
|
@@ -9190,7 +9190,7 @@ return jQuery;
|
|
9190
9190
|
}));
|
9191
9191
|
|
9192
9192
|
/**
|
9193
|
-
* @license AngularJS v1.3.
|
9193
|
+
* @license AngularJS v1.3.8
|
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.
|
9249
|
+
message = message + '\nhttp://errors.angularjs.org/1.3.8/' +
|
9250
9250
|
(module ? module + '/' : '') + code;
|
9251
9251
|
for (i = 2; i < arguments.length; i++) {
|
9252
9252
|
message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
|
@@ -9657,6 +9657,8 @@ noop.$inject = [];
|
|
9657
9657
|
return (transformationFn || angular.identity)(value);
|
9658
9658
|
};
|
9659
9659
|
```
|
9660
|
+
* @param {*} value to be returned.
|
9661
|
+
* @returns {*} the value passed in.
|
9660
9662
|
*/
|
9661
9663
|
function identity($) {return $;}
|
9662
9664
|
identity.$inject = [];
|
@@ -9911,7 +9913,7 @@ function arrayRemove(array, value) {
|
|
9911
9913
|
* Creates a deep copy of `source`, which should be an object or an array.
|
9912
9914
|
*
|
9913
9915
|
* * If no destination is supplied, a copy of the object or array is created.
|
9914
|
-
* * If a destination is provided, all of its elements (for
|
9916
|
+
* * If a destination is provided, all of its elements (for arrays) or properties (for objects)
|
9915
9917
|
* are deleted and then all elements/properties from the source are copied to it.
|
9916
9918
|
* * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.
|
9917
9919
|
* * If `source` is identical to 'destination' an exception will be thrown.
|
@@ -10249,7 +10251,7 @@ function toJson(obj, pretty) {
|
|
10249
10251
|
* Deserializes a JSON string.
|
10250
10252
|
*
|
10251
10253
|
* @param {string} json JSON string to deserialize.
|
10252
|
-
* @returns {Object|Array|string|number} Deserialized
|
10254
|
+
* @returns {Object|Array|string|number} Deserialized JSON string.
|
10253
10255
|
*/
|
10254
10256
|
function fromJson(json) {
|
10255
10257
|
return isString(json)
|
@@ -10422,7 +10424,7 @@ function getNgAttribute(element, ngAttr) {
|
|
10422
10424
|
* {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.
|
10423
10425
|
*
|
10424
10426
|
* You can specify an **AngularJS module** to be used as the root module for the application. This
|
10425
|
-
* module will be loaded into the {@link auto.$injector} when the application is bootstrapped
|
10427
|
+
* module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It
|
10426
10428
|
* should contain the application code needed or have dependencies on other modules that will
|
10427
10429
|
* contain the code. See {@link angular.module} for more information.
|
10428
10430
|
*
|
@@ -10430,7 +10432,7 @@ function getNgAttribute(element, ngAttr) {
|
|
10430
10432
|
* document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
|
10431
10433
|
* would not be resolved to `3`.
|
10432
10434
|
*
|
10433
|
-
* `ngApp` is the easiest, and most common
|
10435
|
+
* `ngApp` is the easiest, and most common way to bootstrap an application.
|
10434
10436
|
*
|
10435
10437
|
<example module="ngAppDemo">
|
10436
10438
|
<file name="index.html">
|
@@ -11308,11 +11310,11 @@ function toDebugString(obj) {
|
|
11308
11310
|
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
|
11309
11311
|
*/
|
11310
11312
|
var version = {
|
11311
|
-
full: '1.3.
|
11313
|
+
full: '1.3.8', // all of these placeholder strings will be replaced by grunt's
|
11312
11314
|
major: 1, // package task
|
11313
11315
|
minor: 3,
|
11314
|
-
dot:
|
11315
|
-
codeName: '
|
11316
|
+
dot: 8,
|
11317
|
+
codeName: 'prophetic-narwhal'
|
11316
11318
|
};
|
11317
11319
|
|
11318
11320
|
|
@@ -25186,7 +25188,7 @@ var $compileMinErr = minErr('$compile');
|
|
25186
25188
|
* @description
|
25187
25189
|
* The `$templateRequest` service downloads the provided template using `$http` and, upon success,
|
25188
25190
|
* stores the contents inside of `$templateCache`. If the HTTP request fails or the response data
|
25189
|
-
* of the HTTP request is empty
|
25191
|
+
* of the HTTP request is empty, a `$compile` error will be thrown (the exception can be thwarted
|
25190
25192
|
* by setting the 2nd parameter of the function to true).
|
25191
25193
|
*
|
25192
25194
|
* @param {string} tpl The HTTP request template URL
|
@@ -25746,19 +25748,26 @@ function $FilterProvider($provide) {
|
|
25746
25748
|
*
|
25747
25749
|
* Can be one of:
|
25748
25750
|
*
|
25749
|
-
* - `string`: The string is
|
25750
|
-
*
|
25751
|
-
*
|
25751
|
+
* - `string`: The string is used for matching against the contents of the `array`. All strings or
|
25752
|
+
* objects with string properties in `array` that match this string will be returned. This also
|
25753
|
+
* applies to nested object properties.
|
25754
|
+
* The predicate can be negated by prefixing the string with `!`.
|
25752
25755
|
*
|
25753
25756
|
* - `Object`: A pattern object can be used to filter specific properties on objects contained
|
25754
25757
|
* by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items
|
25755
25758
|
* which have property `name` containing "M" and property `phone` containing "1". A special
|
25756
25759
|
* property name `$` can be used (as in `{$:"text"}`) to accept a match against any
|
25757
|
-
* property of the object. That's equivalent to the simple
|
25758
|
-
* as described above. The predicate can be negated by prefixing
|
25759
|
-
*
|
25760
|
+
* property of the object or its nested object properties. That's equivalent to the simple
|
25761
|
+
* substring match with a `string` as described above. The predicate can be negated by prefixing
|
25762
|
+
* the string with `!`.
|
25763
|
+
* For example `{name: "!M"}` predicate will return an array of items which have property `name`
|
25760
25764
|
* not containing "M".
|
25761
25765
|
*
|
25766
|
+
* Note that a named property will match properties on the same level only, while the special
|
25767
|
+
* `$` property will match properties on the same level or deeper. E.g. an array item like
|
25768
|
+
* `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but
|
25769
|
+
* **will** be matched by `{$: 'John'}`.
|
25770
|
+
*
|
25762
25771
|
* - `function(value, index)`: A predicate function can be used to write arbitrary filters. The
|
25763
25772
|
* function is called for each element of `array`. The final result is an array of those
|
25764
25773
|
* elements that the predicate returned true for.
|
@@ -25771,10 +25780,10 @@ function $FilterProvider($provide) {
|
|
25771
25780
|
*
|
25772
25781
|
* - `function(actual, expected)`:
|
25773
25782
|
* The function will be given the object value and the predicate value to compare and
|
25774
|
-
* should return true if
|
25783
|
+
* should return true if both values should be considered equal.
|
25775
25784
|
*
|
25776
|
-
* - `true`: A shorthand for `function(actual, expected) { return angular.equals(
|
25777
|
-
*
|
25785
|
+
* - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.
|
25786
|
+
* This is essentially strict comparison of expected and actual.
|
25778
25787
|
*
|
25779
25788
|
* - `false|undefined`: A short hand for a function which will look for a substring match in case
|
25780
25789
|
* insensitive way.
|
@@ -25877,6 +25886,7 @@ function filterFilter() {
|
|
25877
25886
|
|
25878
25887
|
// Helper functions for `filterFilter`
|
25879
25888
|
function createPredicateFn(expression, comparator, matchAgainstAnyProp) {
|
25889
|
+
var shouldMatchPrimitives = isObject(expression) && ('$' in expression);
|
25880
25890
|
var predicateFn;
|
25881
25891
|
|
25882
25892
|
if (comparator === true) {
|
@@ -25895,13 +25905,16 @@ function createPredicateFn(expression, comparator, matchAgainstAnyProp) {
|
|
25895
25905
|
}
|
25896
25906
|
|
25897
25907
|
predicateFn = function(item) {
|
25908
|
+
if (shouldMatchPrimitives && !isObject(item)) {
|
25909
|
+
return deepCompare(item, expression.$, comparator, false);
|
25910
|
+
}
|
25898
25911
|
return deepCompare(item, expression, comparator, matchAgainstAnyProp);
|
25899
25912
|
};
|
25900
25913
|
|
25901
25914
|
return predicateFn;
|
25902
25915
|
}
|
25903
25916
|
|
25904
|
-
function deepCompare(actual, expected, comparator, matchAgainstAnyProp) {
|
25917
|
+
function deepCompare(actual, expected, comparator, matchAgainstAnyProp, dontMatchWholeObject) {
|
25905
25918
|
var actualType = typeof actual;
|
25906
25919
|
var expectedType = typeof expected;
|
25907
25920
|
|
@@ -25920,11 +25933,11 @@ function deepCompare(actual, expected, comparator, matchAgainstAnyProp) {
|
|
25920
25933
|
var key;
|
25921
25934
|
if (matchAgainstAnyProp) {
|
25922
25935
|
for (key in actual) {
|
25923
|
-
if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator)) {
|
25936
|
+
if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, true)) {
|
25924
25937
|
return true;
|
25925
25938
|
}
|
25926
25939
|
}
|
25927
|
-
return false;
|
25940
|
+
return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, false);
|
25928
25941
|
} else if (expectedType === 'object') {
|
25929
25942
|
for (key in expected) {
|
25930
25943
|
var expectedVal = expected[key];
|
@@ -25932,9 +25945,9 @@ function deepCompare(actual, expected, comparator, matchAgainstAnyProp) {
|
|
25932
25945
|
continue;
|
25933
25946
|
}
|
25934
25947
|
|
25935
|
-
var
|
25936
|
-
var actualVal =
|
25937
|
-
if (!deepCompare(actualVal, expectedVal, comparator,
|
25948
|
+
var matchAnyProperty = key === '$';
|
25949
|
+
var actualVal = matchAnyProperty ? actual : actual[key];
|
25950
|
+
if (!deepCompare(actualVal, expectedVal, comparator, matchAnyProperty, matchAnyProperty)) {
|
25938
25951
|
return false;
|
25939
25952
|
}
|
25940
25953
|
}
|
@@ -26607,8 +26620,7 @@ function limitToFilter() {
|
|
26607
26620
|
}
|
26608
26621
|
}
|
26609
26622
|
|
26610
|
-
var
|
26611
|
-
i, n;
|
26623
|
+
var i, n;
|
26612
26624
|
|
26613
26625
|
// if abs(limit) exceeds maximum length, trim it
|
26614
26626
|
if (limit > input.length)
|
@@ -26620,15 +26632,14 @@ function limitToFilter() {
|
|
26620
26632
|
i = 0;
|
26621
26633
|
n = limit;
|
26622
26634
|
} else {
|
26635
|
+
// zero and NaN check on limit - return empty array
|
26636
|
+
if (!limit) return [];
|
26637
|
+
|
26623
26638
|
i = input.length + limit;
|
26624
26639
|
n = input.length;
|
26625
26640
|
}
|
26626
26641
|
|
26627
|
-
|
26628
|
-
out.push(input[i]);
|
26629
|
-
}
|
26630
|
-
|
26631
|
-
return out;
|
26642
|
+
return input.slice(i, n);
|
26632
26643
|
};
|
26633
26644
|
}
|
26634
26645
|
|
@@ -26762,9 +26773,7 @@ function orderByFilter($parse) {
|
|
26762
26773
|
}
|
26763
26774
|
if (predicate === '') {
|
26764
26775
|
// Effectively no predicate was passed so we compare identity
|
26765
|
-
return reverseComparator(
|
26766
|
-
return compare(a, b);
|
26767
|
-
}, descending);
|
26776
|
+
return reverseComparator(compare, descending);
|
26768
26777
|
}
|
26769
26778
|
get = $parse(predicate);
|
26770
26779
|
if (get.constant) {
|
@@ -26806,14 +26815,14 @@ function orderByFilter($parse) {
|
|
26806
26815
|
|
26807
26816
|
function objectToString(value) {
|
26808
26817
|
if (value === null) return 'null';
|
26809
|
-
if (typeof value.toString === 'function') {
|
26810
|
-
value = value.toString();
|
26811
|
-
if (isPrimitive(value)) return value;
|
26812
|
-
}
|
26813
26818
|
if (typeof value.valueOf === 'function') {
|
26814
26819
|
value = value.valueOf();
|
26815
26820
|
if (isPrimitive(value)) return value;
|
26816
26821
|
}
|
26822
|
+
if (typeof value.toString === 'function') {
|
26823
|
+
value = value.toString();
|
26824
|
+
if (isPrimitive(value)) return value;
|
26825
|
+
}
|
26817
26826
|
return '';
|
26818
26827
|
}
|
26819
26828
|
|
@@ -34465,14 +34474,15 @@ var ngOptionsMinErr = minErr('ngOptions');
|
|
34465
34474
|
*
|
34466
34475
|
* The `ngOptions` attribute can be used to dynamically generate a list of `<option>`
|
34467
34476
|
* elements for the `<select>` element using the array or object obtained by evaluating the
|
34468
|
-
* `ngOptions`
|
34477
|
+
* `ngOptions` comprehension expression.
|
34469
34478
|
*
|
34470
34479
|
* In many cases, `ngRepeat` can be used on `<option>` elements instead of `ngOptions` to achieve a
|
34471
|
-
* similar result. However,
|
34480
|
+
* similar result. However, `ngOptions` provides some benefits such as reducing memory and
|
34472
34481
|
* increasing speed by not creating a new scope for each repeated instance, as well as providing
|
34473
|
-
* more flexibility in how the
|
34474
|
-
* used when the
|
34475
|
-
* element can only be bound to string values at
|
34482
|
+
* more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the
|
34483
|
+
* comprehension expression. `ngOptions` should be used when the `<select>` model needs to be bound
|
34484
|
+
* to a non-string value. This is because an option element can only be bound to string values at
|
34485
|
+
* present.
|
34476
34486
|
*
|
34477
34487
|
* When an item in the `<select>` menu is selected, the array element or object property
|
34478
34488
|
* represented by the selected option will be bound to the model identified by the `ngModel`
|
@@ -34487,28 +34497,51 @@ var ngOptionsMinErr = minErr('ngOptions');
|
|
34487
34497
|
* array of objects. See an example [in this jsfiddle](http://jsfiddle.net/qWzTb/).
|
34488
34498
|
* </div>
|
34489
34499
|
*
|
34490
|
-
* ## `select as
|
34500
|
+
* ## `select` **`as`**
|
34491
34501
|
*
|
34492
|
-
* Using `select as
|
34502
|
+
* Using `select` **`as`** will bind the result of the `select` expression to the model, but
|
34493
34503
|
* the value of the `<select>` and `<option>` html elements will be either the index (for array data sources)
|
34494
|
-
* or property name (for object data sources) of the value within the collection. If a
|
34504
|
+
* or property name (for object data sources) of the value within the collection. If a **`track by`** expression
|
34495
34505
|
* is used, the result of that expression will be set as the value of the `option` and `select` elements.
|
34496
34506
|
*
|
34497
|
-
*
|
34498
|
-
*
|
34499
|
-
*
|
34500
|
-
*
|
34501
|
-
*
|
34502
|
-
*
|
34503
|
-
*
|
34504
|
-
*
|
34505
|
-
*
|
34506
|
-
*
|
34507
|
-
*
|
34508
|
-
*
|
34509
|
-
*
|
34510
|
-
*
|
34511
|
-
*
|
34507
|
+
*
|
34508
|
+
* ### `select` **`as`** and **`track by`**
|
34509
|
+
*
|
34510
|
+
* <div class="alert alert-warning">
|
34511
|
+
* Do not use `select` **`as`** and **`track by`** in the same expression. They are not designed to work together.
|
34512
|
+
* </div>
|
34513
|
+
*
|
34514
|
+
* Consider the following example:
|
34515
|
+
*
|
34516
|
+
* ```html
|
34517
|
+
* <select ng-options="item.subItem as item.label for item in values track by item.id" ng-model="selected">
|
34518
|
+
* ```
|
34519
|
+
*
|
34520
|
+
* ```js
|
34521
|
+
* $scope.values = [{
|
34522
|
+
* id: 1,
|
34523
|
+
* label: 'aLabel',
|
34524
|
+
* subItem: { name: 'aSubItem' }
|
34525
|
+
* }, {
|
34526
|
+
* id: 2,
|
34527
|
+
* label: 'bLabel',
|
34528
|
+
* subItem: { name: 'bSubItem' }
|
34529
|
+
* }];
|
34530
|
+
*
|
34531
|
+
* $scope.selected = { name: 'aSubItem' };
|
34532
|
+
* ```
|
34533
|
+
*
|
34534
|
+
* With the purpose of preserving the selection, the **`track by`** expression is always applied to the element
|
34535
|
+
* of the data source (to `item` in this example). To calculate whether an element is selected, we do the
|
34536
|
+
* following:
|
34537
|
+
*
|
34538
|
+
* 1. Apply **`track by`** to the elements in the array. In the example: `[1, 2]`
|
34539
|
+
* 2. Apply **`track by`** to the already selected value in `ngModel`.
|
34540
|
+
* In the example: this is not possible as **`track by`** refers to `item.id`, but the selected
|
34541
|
+
* value from `ngModel` is `{name: 'aSubItem'}`, so the **`track by`** expression is applied to
|
34542
|
+
* a wrong object, the selected element can't be found, `<select>` is always reset to the "not
|
34543
|
+
* selected" option.
|
34544
|
+
*
|
34512
34545
|
*
|
34513
34546
|
* @param {string} ngModel Assignable angular expression to data-bind to.
|
34514
34547
|
* @param {string=} name Property name of the form under which the control is published.
|