angular-gem 1.3.7 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +8 -8
  2. data/lib/angular-gem/version.rb +1 -1
  3. data/vendor/assets/javascripts/1.3.8/angular-animate.js +2138 -0
  4. data/vendor/assets/javascripts/1.3.8/angular-aria.js +339 -0
  5. data/vendor/assets/javascripts/1.3.8/angular-cookies.js +206 -0
  6. data/vendor/assets/javascripts/1.3.8/angular-loader.js +405 -0
  7. data/vendor/assets/javascripts/1.3.8/angular-messages.js +400 -0
  8. data/vendor/assets/javascripts/1.3.8/angular-mocks.js +2382 -0
  9. data/vendor/assets/javascripts/1.3.8/angular-resource.js +667 -0
  10. data/vendor/assets/javascripts/1.3.8/angular-route.js +995 -0
  11. data/vendor/assets/javascripts/1.3.8/angular-sanitize.js +680 -0
  12. data/vendor/assets/javascripts/1.3.8/angular-scenario.js +37424 -0
  13. data/vendor/assets/javascripts/1.3.8/angular-touch.js +622 -0
  14. data/vendor/assets/javascripts/1.3.8/angular.js +26070 -0
  15. data/vendor/assets/javascripts/angular-animate.js +3 -2
  16. data/vendor/assets/javascripts/angular-aria.js +20 -13
  17. data/vendor/assets/javascripts/angular-cookies.js +1 -1
  18. data/vendor/assets/javascripts/angular-loader.js +2 -2
  19. data/vendor/assets/javascripts/angular-messages.js +1 -1
  20. data/vendor/assets/javascripts/angular-mocks.js +15 -15
  21. data/vendor/assets/javascripts/angular-resource.js +1 -1
  22. data/vendor/assets/javascripts/angular-route.js +1 -1
  23. data/vendor/assets/javascripts/angular-sanitize.js +1 -1
  24. data/vendor/assets/javascripts/angular-scenario.js +95 -62
  25. data/vendor/assets/javascripts/angular-touch.js +1 -1
  26. data/vendor/assets/javascripts/angular.js +95 -62
  27. metadata +14 -2
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.3.7
2
+ * @license AngularJS v1.3.8
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.3.7
2
+ * @license AngularJS v1.3.8
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -54,7 +54,7 @@ function minErr(module, ErrorConstructor) {
54
54
  return match;
55
55
  });
56
56
 
57
- message = message + '\nhttp://errors.angularjs.org/1.3.7/' +
57
+ message = message + '\nhttp://errors.angularjs.org/1.3.8/' +
58
58
  (module ? module + '/' : '') + code;
59
59
  for (i = 2; i < arguments.length; i++) {
60
60
  message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
@@ -465,6 +465,8 @@ noop.$inject = [];
465
465
  return (transformationFn || angular.identity)(value);
466
466
  };
467
467
  ```
468
+ * @param {*} value to be returned.
469
+ * @returns {*} the value passed in.
468
470
  */
469
471
  function identity($) {return $;}
470
472
  identity.$inject = [];
@@ -719,7 +721,7 @@ function arrayRemove(array, value) {
719
721
  * Creates a deep copy of `source`, which should be an object or an array.
720
722
  *
721
723
  * * If no destination is supplied, a copy of the object or array is created.
722
- * * If a destination is provided, all of its elements (for array) or properties (for objects)
724
+ * * If a destination is provided, all of its elements (for arrays) or properties (for objects)
723
725
  * are deleted and then all elements/properties from the source are copied to it.
724
726
  * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.
725
727
  * * If `source` is identical to 'destination' an exception will be thrown.
@@ -1057,7 +1059,7 @@ function toJson(obj, pretty) {
1057
1059
  * Deserializes a JSON string.
1058
1060
  *
1059
1061
  * @param {string} json JSON string to deserialize.
1060
- * @returns {Object|Array|string|number} Deserialized thingy.
1062
+ * @returns {Object|Array|string|number} Deserialized JSON string.
1061
1063
  */
1062
1064
  function fromJson(json) {
1063
1065
  return isString(json)
@@ -1230,7 +1232,7 @@ function getNgAttribute(element, ngAttr) {
1230
1232
  * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.
1231
1233
  *
1232
1234
  * You can specify an **AngularJS module** to be used as the root module for the application. This
1233
- * module will be loaded into the {@link auto.$injector} when the application is bootstrapped and
1235
+ * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It
1234
1236
  * should contain the application code needed or have dependencies on other modules that will
1235
1237
  * contain the code. See {@link angular.module} for more information.
1236
1238
  *
@@ -1238,7 +1240,7 @@ function getNgAttribute(element, ngAttr) {
1238
1240
  * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
1239
1241
  * would not be resolved to `3`.
1240
1242
  *
1241
- * `ngApp` is the easiest, and most common, way to bootstrap an application.
1243
+ * `ngApp` is the easiest, and most common way to bootstrap an application.
1242
1244
  *
1243
1245
  <example module="ngAppDemo">
1244
1246
  <file name="index.html">
@@ -2116,11 +2118,11 @@ function toDebugString(obj) {
2116
2118
  * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
2117
2119
  */
2118
2120
  var version = {
2119
- full: '1.3.7', // all of these placeholder strings will be replaced by grunt's
2121
+ full: '1.3.8', // all of these placeholder strings will be replaced by grunt's
2120
2122
  major: 1, // package task
2121
2123
  minor: 3,
2122
- dot: 7,
2123
- codeName: 'leaky-obstruction'
2124
+ dot: 8,
2125
+ codeName: 'prophetic-narwhal'
2124
2126
  };
2125
2127
 
2126
2128
 
@@ -15994,7 +15996,7 @@ var $compileMinErr = minErr('$compile');
15994
15996
  * @description
15995
15997
  * The `$templateRequest` service downloads the provided template using `$http` and, upon success,
15996
15998
  * stores the contents inside of `$templateCache`. If the HTTP request fails or the response data
15997
- * of the HTTP request is empty then a `$compile` error will be thrown (the exception can be thwarted
15999
+ * of the HTTP request is empty, a `$compile` error will be thrown (the exception can be thwarted
15998
16000
  * by setting the 2nd parameter of the function to true).
15999
16001
  *
16000
16002
  * @param {string} tpl The HTTP request template URL
@@ -16554,19 +16556,26 @@ function $FilterProvider($provide) {
16554
16556
  *
16555
16557
  * Can be one of:
16556
16558
  *
16557
- * - `string`: The string is evaluated as an expression and the resulting value is used for substring match against
16558
- * the contents of the `array`. All strings or objects with string properties in `array` that contain this string
16559
- * will be returned. The predicate can be negated by prefixing the string with `!`.
16559
+ * - `string`: The string is used for matching against the contents of the `array`. All strings or
16560
+ * objects with string properties in `array` that match this string will be returned. This also
16561
+ * applies to nested object properties.
16562
+ * The predicate can be negated by prefixing the string with `!`.
16560
16563
  *
16561
16564
  * - `Object`: A pattern object can be used to filter specific properties on objects contained
16562
16565
  * by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items
16563
16566
  * which have property `name` containing "M" and property `phone` containing "1". A special
16564
16567
  * property name `$` can be used (as in `{$:"text"}`) to accept a match against any
16565
- * property of the object. That's equivalent to the simple substring match with a `string`
16566
- * as described above. The predicate can be negated by prefixing the string with `!`.
16567
- * For Example `{name: "!M"}` predicate will return an array of items which have property `name`
16568
+ * property of the object or its nested object properties. That's equivalent to the simple
16569
+ * substring match with a `string` as described above. The predicate can be negated by prefixing
16570
+ * the string with `!`.
16571
+ * For example `{name: "!M"}` predicate will return an array of items which have property `name`
16568
16572
  * not containing "M".
16569
16573
  *
16574
+ * Note that a named property will match properties on the same level only, while the special
16575
+ * `$` property will match properties on the same level or deeper. E.g. an array item like
16576
+ * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but
16577
+ * **will** be matched by `{$: 'John'}`.
16578
+ *
16570
16579
  * - `function(value, index)`: A predicate function can be used to write arbitrary filters. The
16571
16580
  * function is called for each element of `array`. The final result is an array of those
16572
16581
  * elements that the predicate returned true for.
@@ -16579,10 +16588,10 @@ function $FilterProvider($provide) {
16579
16588
  *
16580
16589
  * - `function(actual, expected)`:
16581
16590
  * The function will be given the object value and the predicate value to compare and
16582
- * should return true if the item should be included in filtered result.
16591
+ * should return true if both values should be considered equal.
16583
16592
  *
16584
- * - `true`: A shorthand for `function(actual, expected) { return angular.equals(expected, actual)}`.
16585
- * this is essentially strict comparison of expected and actual.
16593
+ * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.
16594
+ * This is essentially strict comparison of expected and actual.
16586
16595
  *
16587
16596
  * - `false|undefined`: A short hand for a function which will look for a substring match in case
16588
16597
  * insensitive way.
@@ -16685,6 +16694,7 @@ function filterFilter() {
16685
16694
 
16686
16695
  // Helper functions for `filterFilter`
16687
16696
  function createPredicateFn(expression, comparator, matchAgainstAnyProp) {
16697
+ var shouldMatchPrimitives = isObject(expression) && ('$' in expression);
16688
16698
  var predicateFn;
16689
16699
 
16690
16700
  if (comparator === true) {
@@ -16703,13 +16713,16 @@ function createPredicateFn(expression, comparator, matchAgainstAnyProp) {
16703
16713
  }
16704
16714
 
16705
16715
  predicateFn = function(item) {
16716
+ if (shouldMatchPrimitives && !isObject(item)) {
16717
+ return deepCompare(item, expression.$, comparator, false);
16718
+ }
16706
16719
  return deepCompare(item, expression, comparator, matchAgainstAnyProp);
16707
16720
  };
16708
16721
 
16709
16722
  return predicateFn;
16710
16723
  }
16711
16724
 
16712
- function deepCompare(actual, expected, comparator, matchAgainstAnyProp) {
16725
+ function deepCompare(actual, expected, comparator, matchAgainstAnyProp, dontMatchWholeObject) {
16713
16726
  var actualType = typeof actual;
16714
16727
  var expectedType = typeof expected;
16715
16728
 
@@ -16728,11 +16741,11 @@ function deepCompare(actual, expected, comparator, matchAgainstAnyProp) {
16728
16741
  var key;
16729
16742
  if (matchAgainstAnyProp) {
16730
16743
  for (key in actual) {
16731
- if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator)) {
16744
+ if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, true)) {
16732
16745
  return true;
16733
16746
  }
16734
16747
  }
16735
- return false;
16748
+ return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, false);
16736
16749
  } else if (expectedType === 'object') {
16737
16750
  for (key in expected) {
16738
16751
  var expectedVal = expected[key];
@@ -16740,9 +16753,9 @@ function deepCompare(actual, expected, comparator, matchAgainstAnyProp) {
16740
16753
  continue;
16741
16754
  }
16742
16755
 
16743
- var keyIsDollar = key === '$';
16744
- var actualVal = keyIsDollar ? actual : actual[key];
16745
- if (!deepCompare(actualVal, expectedVal, comparator, keyIsDollar)) {
16756
+ var matchAnyProperty = key === '$';
16757
+ var actualVal = matchAnyProperty ? actual : actual[key];
16758
+ if (!deepCompare(actualVal, expectedVal, comparator, matchAnyProperty, matchAnyProperty)) {
16746
16759
  return false;
16747
16760
  }
16748
16761
  }
@@ -17415,8 +17428,7 @@ function limitToFilter() {
17415
17428
  }
17416
17429
  }
17417
17430
 
17418
- var out = [],
17419
- i, n;
17431
+ var i, n;
17420
17432
 
17421
17433
  // if abs(limit) exceeds maximum length, trim it
17422
17434
  if (limit > input.length)
@@ -17428,15 +17440,14 @@ function limitToFilter() {
17428
17440
  i = 0;
17429
17441
  n = limit;
17430
17442
  } else {
17443
+ // zero and NaN check on limit - return empty array
17444
+ if (!limit) return [];
17445
+
17431
17446
  i = input.length + limit;
17432
17447
  n = input.length;
17433
17448
  }
17434
17449
 
17435
- for (; i < n; i++) {
17436
- out.push(input[i]);
17437
- }
17438
-
17439
- return out;
17450
+ return input.slice(i, n);
17440
17451
  };
17441
17452
  }
17442
17453
 
@@ -17570,9 +17581,7 @@ function orderByFilter($parse) {
17570
17581
  }
17571
17582
  if (predicate === '') {
17572
17583
  // Effectively no predicate was passed so we compare identity
17573
- return reverseComparator(function(a, b) {
17574
- return compare(a, b);
17575
- }, descending);
17584
+ return reverseComparator(compare, descending);
17576
17585
  }
17577
17586
  get = $parse(predicate);
17578
17587
  if (get.constant) {
@@ -17614,14 +17623,14 @@ function orderByFilter($parse) {
17614
17623
 
17615
17624
  function objectToString(value) {
17616
17625
  if (value === null) return 'null';
17617
- if (typeof value.toString === 'function') {
17618
- value = value.toString();
17619
- if (isPrimitive(value)) return value;
17620
- }
17621
17626
  if (typeof value.valueOf === 'function') {
17622
17627
  value = value.valueOf();
17623
17628
  if (isPrimitive(value)) return value;
17624
17629
  }
17630
+ if (typeof value.toString === 'function') {
17631
+ value = value.toString();
17632
+ if (isPrimitive(value)) return value;
17633
+ }
17625
17634
  return '';
17626
17635
  }
17627
17636
 
@@ -25273,14 +25282,15 @@ var ngOptionsMinErr = minErr('ngOptions');
25273
25282
  *
25274
25283
  * The `ngOptions` attribute can be used to dynamically generate a list of `<option>`
25275
25284
  * elements for the `<select>` element using the array or object obtained by evaluating the
25276
- * `ngOptions` comprehension_expression.
25285
+ * `ngOptions` comprehension expression.
25277
25286
  *
25278
25287
  * In many cases, `ngRepeat` can be used on `<option>` elements instead of `ngOptions` to achieve a
25279
- * similar result. However, the `ngOptions` provides some benefits such as reducing memory and
25288
+ * similar result. However, `ngOptions` provides some benefits such as reducing memory and
25280
25289
  * increasing speed by not creating a new scope for each repeated instance, as well as providing
25281
- * more flexibility in how the `select`'s model is assigned via `select as`. `ngOptions` should be
25282
- * used when the `select` model needs to be bound to a non-string value. This is because an option
25283
- * element can only be bound to string values at present.
25290
+ * more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the
25291
+ * comprehension expression. `ngOptions` should be used when the `<select>` model needs to be bound
25292
+ * to a non-string value. This is because an option element can only be bound to string values at
25293
+ * present.
25284
25294
  *
25285
25295
  * When an item in the `<select>` menu is selected, the array element or object property
25286
25296
  * represented by the selected option will be bound to the model identified by the `ngModel`
@@ -25295,28 +25305,51 @@ var ngOptionsMinErr = minErr('ngOptions');
25295
25305
  * array of objects. See an example [in this jsfiddle](http://jsfiddle.net/qWzTb/).
25296
25306
  * </div>
25297
25307
  *
25298
- * ## `select as`
25308
+ * ## `select` **`as`**
25299
25309
  *
25300
- * Using `select as` will bind the result of the `select as` expression to the model, but
25310
+ * Using `select` **`as`** will bind the result of the `select` expression to the model, but
25301
25311
  * the value of the `<select>` and `<option>` html elements will be either the index (for array data sources)
25302
- * or property name (for object data sources) of the value within the collection. If a `track by` expression
25312
+ * or property name (for object data sources) of the value within the collection. If a **`track by`** expression
25303
25313
  * is used, the result of that expression will be set as the value of the `option` and `select` elements.
25304
25314
  *
25305
- * ### `select as` with `track by`
25306
- *
25307
- * Using `select as` together with `track by` is not recommended. Reasoning:
25308
- *
25309
- * - Example: &lt;select ng-options="item.subItem as item.label for item in values track by item.id" ng-model="selected"&gt;
25310
- * values: [{id: 1, label: 'aLabel', subItem: {name: 'aSubItem'}}, {id: 2, label: 'bLabel', subItem: {name: 'bSubItem'}}],
25311
- * $scope.selected = {name: 'aSubItem'};
25312
- * - track by is always applied to `value`, with the purpose of preserving the selection,
25313
- * (to `item` in this case)
25314
- * - to calculate whether an item is selected we do the following:
25315
- * 1. apply `track by` to the values in the array, e.g.
25316
- * In the example: [1,2]
25317
- * 2. apply `track by` to the already selected value in `ngModel`:
25318
- * In the example: this is not possible, as `track by` refers to `item.id`, but the selected
25319
- * value from `ngModel` is `{name: aSubItem}`.
25315
+ *
25316
+ * ### `select` **`as`** and **`track by`**
25317
+ *
25318
+ * <div class="alert alert-warning">
25319
+ * Do not use `select` **`as`** and **`track by`** in the same expression. They are not designed to work together.
25320
+ * </div>
25321
+ *
25322
+ * Consider the following example:
25323
+ *
25324
+ * ```html
25325
+ * <select ng-options="item.subItem as item.label for item in values track by item.id" ng-model="selected">
25326
+ * ```
25327
+ *
25328
+ * ```js
25329
+ * $scope.values = [{
25330
+ * id: 1,
25331
+ * label: 'aLabel',
25332
+ * subItem: { name: 'aSubItem' }
25333
+ * }, {
25334
+ * id: 2,
25335
+ * label: 'bLabel',
25336
+ * subItem: { name: 'bSubItem' }
25337
+ * }];
25338
+ *
25339
+ * $scope.selected = { name: 'aSubItem' };
25340
+ * ```
25341
+ *
25342
+ * With the purpose of preserving the selection, the **`track by`** expression is always applied to the element
25343
+ * of the data source (to `item` in this example). To calculate whether an element is selected, we do the
25344
+ * following:
25345
+ *
25346
+ * 1. Apply **`track by`** to the elements in the array. In the example: `[1, 2]`
25347
+ * 2. Apply **`track by`** to the already selected value in `ngModel`.
25348
+ * In the example: this is not possible as **`track by`** refers to `item.id`, but the selected
25349
+ * value from `ngModel` is `{name: 'aSubItem'}`, so the **`track by`** expression is applied to
25350
+ * a wrong object, the selected element can't be found, `<select>` is always reset to the "not
25351
+ * selected" option.
25352
+ *
25320
25353
  *
25321
25354
  * @param {string} ngModel Assignable angular expression to data-bind to.
25322
25355
  * @param {string=} name Property name of the form under which the control is published.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angular-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Vuerings
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-20 00:00:00.000000000 Z
11
+ date: 2015-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -1092,6 +1092,18 @@ files:
1092
1092
  - vendor/assets/javascripts/1.3.7/angular-scenario.js
1093
1093
  - vendor/assets/javascripts/1.3.7/angular-touch.js
1094
1094
  - vendor/assets/javascripts/1.3.7/angular.js
1095
+ - vendor/assets/javascripts/1.3.8/angular-animate.js
1096
+ - vendor/assets/javascripts/1.3.8/angular-aria.js
1097
+ - vendor/assets/javascripts/1.3.8/angular-cookies.js
1098
+ - vendor/assets/javascripts/1.3.8/angular-loader.js
1099
+ - vendor/assets/javascripts/1.3.8/angular-messages.js
1100
+ - vendor/assets/javascripts/1.3.8/angular-mocks.js
1101
+ - vendor/assets/javascripts/1.3.8/angular-resource.js
1102
+ - vendor/assets/javascripts/1.3.8/angular-route.js
1103
+ - vendor/assets/javascripts/1.3.8/angular-sanitize.js
1104
+ - vendor/assets/javascripts/1.3.8/angular-scenario.js
1105
+ - vendor/assets/javascripts/1.3.8/angular-touch.js
1106
+ - vendor/assets/javascripts/1.3.8/angular.js
1095
1107
  - vendor/assets/javascripts/angular-animate.js
1096
1108
  - vendor/assets/javascripts/angular-aria.js
1097
1109
  - vendor/assets/javascripts/angular-cookies.js