angularjs-rails 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff1cc2b9938b70a449ef733e168c09bdfd92150d
4
- data.tar.gz: 1f423457cf1c7f67fde9870f6fd5dd92177210fc
3
+ metadata.gz: 8c6054787e9a21da18e36bf15006d4dc05983f54
4
+ data.tar.gz: 88f127f2e0252380d89c9fee6fd4db293eeab648
5
5
  SHA512:
6
- metadata.gz: c9d3da60563a7654c413582735222d29245b810c8a45418011a8737a92b2698d611ab37065ae0fd9b4985a2e422e1b49412ba23376c499354ea1cf23da936c3b
7
- data.tar.gz: 869e11552cbac05449da26b9656c6729c197cee485c3d05c1ce468d2500960edf54b7b8a40727bd54b84df91552a02822c477e4f54a65263f9aecbb8d9c50b56
6
+ metadata.gz: 188734c17139521f26d60aca6c61fc42fb6c389576b054bb9589127eca34ebbcbc7b8335600a581296806fb409d0a0f448e7913bd220d2cc1f22f5e6d1d4d4da
7
+ data.tar.gz: 2e8fe69fda52a3cbef08c0a266ac849962242b71f8b12956b90831d9deadd0a30f8911dc7765aa943a5e82f950d1775bc680f8f46462b95bae8ee8ba15f57661
@@ -1,6 +1,6 @@
1
1
  module AngularJS
2
2
  module Rails
3
- VERSION = "1.6.0"
3
+ VERSION = "1.6.1"
4
4
  UNSTABLE_VERSION = "2.0.0-beta.17"
5
5
  end
6
6
  end
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -87,7 +87,7 @@ function minErr(module, ErrorConstructor) {
87
87
  return match;
88
88
  });
89
89
 
90
- message += '\nhttp://errors.angularjs.org/1.6.0/' +
90
+ message += '\nhttp://errors.angularjs.org/1.6.1/' +
91
91
  (module ? module + '/' : '') + code;
92
92
 
93
93
  for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -634,10 +634,8 @@ angular.module('ngMessages', [], function initAngularHelpers() {
634
634
  * @scope
635
635
  *
636
636
  * @description
637
- * `ngMessageExp` is a directive with the purpose to show and hide a particular message.
638
- * For `ngMessageExp` to operate, a parent `ngMessages` directive on a parent DOM element
639
- * must be situated since it determines which messages are visible based on the state
640
- * of the provided key/value map that `ngMessages` listens on.
637
+ * `ngMessageExp` is the same as {@link directive:ngMessage `ngMessage`}, but instead of a static
638
+ * value, it accepts an expression to be evaluated for the message key.
641
639
  *
642
640
  * @usage
643
641
  * ```html
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -2534,7 +2534,8 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
2534
2534
  * @param {string} method HTTP method.
2535
2535
  * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
2536
2536
  * and returns true if the url matches the current definition.
2537
- * @param {(string|RegExp)=} data HTTP request body.
2537
+ * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
2538
+ * data string and returns true if the data is as expected.
2538
2539
  * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
2539
2540
  * object and returns true if the headers match the current definition.
2540
2541
  * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on
@@ -2617,7 +2618,8 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
2617
2618
  *
2618
2619
  * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
2619
2620
  * and returns true if the url matches the current definition.
2620
- * @param {(string|RegExp)=} data HTTP request body.
2621
+ * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
2622
+ * data string and returns true if the data is as expected.
2621
2623
  * @param {(Object|function(Object))=} headers HTTP headers.
2622
2624
  * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on
2623
2625
  * {@link ngMock.$httpBackend $httpBackend mock}.
@@ -2635,7 +2637,8 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
2635
2637
  *
2636
2638
  * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
2637
2639
  * and returns true if the url matches the current definition.
2638
- * @param {(string|RegExp)=} data HTTP request body.
2640
+ * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
2641
+ * data string and returns true if the data is as expected.
2639
2642
  * @param {(Object|function(Object))=} headers HTTP headers.
2640
2643
  * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on
2641
2644
  * {@link ngMock.$httpBackend $httpBackend mock}.
@@ -2653,7 +2656,8 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
2653
2656
  *
2654
2657
  * @param {string|RegExp|function(string)=} url HTTP url or function that receives a url
2655
2658
  * and returns true if the url matches the current definition.
2656
- * @param {(string|RegExp)=} data HTTP request body.
2659
+ * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
2660
+ * data string and returns true if the data is as expected.
2657
2661
  * @param {(Object|function(Object))=} headers HTTP headers.
2658
2662
  * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on
2659
2663
  * {@link ngMock.$httpBackend $httpBackend mock}.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -10071,7 +10071,7 @@ return jQuery;
10071
10071
  } );
10072
10072
 
10073
10073
  /**
10074
- * @license AngularJS v1.6.0
10074
+ * @license AngularJS v1.6.1
10075
10075
  * (c) 2010-2016 Google, Inc. http://angularjs.org
10076
10076
  * License: MIT
10077
10077
  */
@@ -10130,7 +10130,7 @@ function minErr(module, ErrorConstructor) {
10130
10130
  return match;
10131
10131
  });
10132
10132
 
10133
- message += '\nhttp://errors.angularjs.org/1.6.0/' +
10133
+ message += '\nhttp://errors.angularjs.org/1.6.1/' +
10134
10134
  (module ? module + '/' : '') + code;
10135
10135
 
10136
10136
  for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
@@ -12696,11 +12696,11 @@ function toDebugString(obj) {
12696
12696
  var version = {
12697
12697
  // These placeholder strings will be replaced by grunt's `build` task.
12698
12698
  // They need to be double- or single-quoted.
12699
- full: '1.6.0',
12699
+ full: '1.6.1',
12700
12700
  major: 1,
12701
12701
  minor: 6,
12702
- dot: 0,
12703
- codeName: 'rainbow-tsunami'
12702
+ dot: 1,
12703
+ codeName: 'promise-rectification'
12704
12704
  };
12705
12705
 
12706
12706
 
@@ -13826,12 +13826,15 @@ forEach({
13826
13826
 
13827
13827
  after: function(element, newElement) {
13828
13828
  var index = element, parent = element.parentNode;
13829
- newElement = new JQLite(newElement);
13830
13829
 
13831
- for (var i = 0, ii = newElement.length; i < ii; i++) {
13832
- var node = newElement[i];
13833
- parent.insertBefore(node, index.nextSibling);
13834
- index = node;
13830
+ if (parent) {
13831
+ newElement = new JQLite(newElement);
13832
+
13833
+ for (var i = 0, ii = newElement.length; i < ii; i++) {
13834
+ var node = newElement[i];
13835
+ parent.insertBefore(node, index.nextSibling);
13836
+ index = node;
13837
+ }
13835
13838
  }
13836
13839
  },
13837
13840
 
@@ -22966,7 +22969,8 @@ function $IntervalProvider() {
22966
22969
  * appropriate moment. See the example below for more details on how and when to do this.
22967
22970
  * </div>
22968
22971
  *
22969
- * @param {function()} fn A function that should be called repeatedly.
22972
+ * @param {function()} fn A function that should be called repeatedly. If no additional arguments
22973
+ * are passed (see below), the function is called with the current iteration count.
22970
22974
  * @param {number} delay Number of milliseconds between each function call.
22971
22975
  * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat
22972
22976
  * indefinitely.
@@ -26597,6 +26601,7 @@ function $QProvider() {
26597
26601
  *
26598
26602
  * @description
26599
26603
  * Retrieves or overrides whether to generate an error when a rejected promise is not handled.
26604
+ * This feature is enabled by default.
26600
26605
  *
26601
26606
  * @param {boolean=} value Whether to generate an error when a rejected promise is not handled.
26602
26607
  * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for
@@ -26738,7 +26743,11 @@ function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
26738
26743
  if (!toCheck.pur) {
26739
26744
  toCheck.pur = true;
26740
26745
  var errorMessage = 'Possibly unhandled rejection: ' + toDebugString(toCheck.value);
26741
- exceptionHandler(errorMessage);
26746
+ if (toCheck.value instanceof Error) {
26747
+ exceptionHandler(toCheck.value, errorMessage);
26748
+ } else {
26749
+ exceptionHandler(errorMessage);
26750
+ }
26742
26751
  }
26743
26752
  }
26744
26753
  }
@@ -27472,15 +27481,21 @@ function $RootScopeProvider() {
27472
27481
 
27473
27482
  if (!array) {
27474
27483
  array = scope.$$watchers = [];
27484
+ array.$$digestWatchIndex = -1;
27475
27485
  }
27476
27486
  // we use unshift since we use a while loop in $digest for speed.
27477
27487
  // the while loop reads in reverse order.
27478
27488
  array.unshift(watcher);
27489
+ array.$$digestWatchIndex++;
27479
27490
  incrementWatchersCount(this, 1);
27480
27491
 
27481
27492
  return function deregisterWatch() {
27482
- if (arrayRemove(array, watcher) >= 0) {
27493
+ var index = arrayRemove(array, watcher);
27494
+ if (index >= 0) {
27483
27495
  incrementWatchersCount(scope, -1);
27496
+ if (index < array.$$digestWatchIndex) {
27497
+ array.$$digestWatchIndex--;
27498
+ }
27484
27499
  }
27485
27500
  lastDirtyWatch = null;
27486
27501
  };
@@ -27813,7 +27828,6 @@ function $RootScopeProvider() {
27813
27828
  $digest: function() {
27814
27829
  var watch, value, last, fn, get,
27815
27830
  watchers,
27816
- length,
27817
27831
  dirty, ttl = TTL,
27818
27832
  next, current, target = this,
27819
27833
  watchLog = [],
@@ -27854,10 +27868,10 @@ function $RootScopeProvider() {
27854
27868
  do { // "traverse the scopes" loop
27855
27869
  if ((watchers = current.$$watchers)) {
27856
27870
  // process our watches
27857
- length = watchers.length;
27858
- while (length--) {
27871
+ watchers.$$digestWatchIndex = watchers.length;
27872
+ while (watchers.$$digestWatchIndex--) {
27859
27873
  try {
27860
- watch = watchers[length];
27874
+ watch = watchers[watchers.$$digestWatchIndex];
27861
27875
  // Most common watches are on primitives, in which case we can short
27862
27876
  // circuit it with === operator, only when === fails do we use .equals
27863
27877
  if (watch) {
@@ -30174,6 +30188,14 @@ function $$CookieReader($document) {
30174
30188
  var lastCookies = {};
30175
30189
  var lastCookieString = '';
30176
30190
 
30191
+ function safeGetCookie(rawDocument) {
30192
+ try {
30193
+ return rawDocument.cookie || '';
30194
+ } catch (e) {
30195
+ return '';
30196
+ }
30197
+ }
30198
+
30177
30199
  function safeDecodeURIComponent(str) {
30178
30200
  try {
30179
30201
  return decodeURIComponent(str);
@@ -30184,7 +30206,7 @@ function $$CookieReader($document) {
30184
30206
 
30185
30207
  return function() {
30186
30208
  var cookieArray, cookie, i, index, name;
30187
- var currentCookieString = rawDocument.cookie || '';
30209
+ var currentCookieString = safeGetCookie(rawDocument);
30188
30210
 
30189
30211
  if (currentCookieString !== lastCookieString) {
30190
30212
  lastCookieString = currentCookieString;
@@ -35772,51 +35794,71 @@ var ngChangeDirective = valueFn({
35772
35794
 
35773
35795
  function classDirective(name, selector) {
35774
35796
  name = 'ngClass' + name;
35775
- return ['$animate', function($animate) {
35797
+ var indexWatchExpression;
35798
+
35799
+ return ['$parse', function($parse) {
35776
35800
  return {
35777
35801
  restrict: 'AC',
35778
35802
  link: function(scope, element, attr) {
35779
- var oldVal;
35803
+ var expression = attr[name].trim();
35804
+ var isOneTime = (expression.charAt(0) === ':') && (expression.charAt(1) === ':');
35780
35805
 
35781
- scope.$watch(attr[name], ngClassWatchAction, true);
35806
+ var watchInterceptor = isOneTime ? toFlatValue : toClassString;
35807
+ var watchExpression = $parse(expression, watchInterceptor);
35808
+ var watchAction = isOneTime ? ngClassOneTimeWatchAction : ngClassWatchAction;
35782
35809
 
35783
- attr.$observe('class', function(value) {
35784
- ngClassWatchAction(scope.$eval(attr[name]));
35785
- });
35810
+ var classCounts = element.data('$classCounts');
35811
+ var oldModulo = true;
35812
+ var oldClassString;
35786
35813
 
35814
+ if (!classCounts) {
35815
+ // Use createMap() to prevent class assumptions involving property
35816
+ // names in Object.prototype
35817
+ classCounts = createMap();
35818
+ element.data('$classCounts', classCounts);
35819
+ }
35787
35820
 
35788
35821
  if (name !== 'ngClass') {
35789
- scope.$watch('$index', function($index, old$index) {
35790
- /* eslint-disable no-bitwise */
35791
- var mod = $index & 1;
35792
- if (mod !== (old$index & 1)) {
35793
- var classes = arrayClasses(scope.$eval(attr[name]));
35794
- if (mod === selector) {
35795
- addClasses(classes);
35796
- } else {
35797
- removeClasses(classes);
35798
- }
35799
- }
35800
- /* eslint-enable */
35801
- });
35822
+ if (!indexWatchExpression) {
35823
+ indexWatchExpression = $parse('$index', function moduloTwo($index) {
35824
+ // eslint-disable-next-line no-bitwise
35825
+ return $index & 1;
35826
+ });
35827
+ }
35828
+
35829
+ scope.$watch(indexWatchExpression, ngClassIndexWatchAction);
35802
35830
  }
35803
35831
 
35804
- function addClasses(classes) {
35805
- var newClasses = digestClassCounts(classes, 1);
35806
- attr.$addClass(newClasses);
35832
+ scope.$watch(watchExpression, watchAction, isOneTime);
35833
+
35834
+ function addClasses(classString) {
35835
+ classString = digestClassCounts(split(classString), 1);
35836
+ attr.$addClass(classString);
35807
35837
  }
35808
35838
 
35809
- function removeClasses(classes) {
35810
- var newClasses = digestClassCounts(classes, -1);
35811
- attr.$removeClass(newClasses);
35839
+ function removeClasses(classString) {
35840
+ classString = digestClassCounts(split(classString), -1);
35841
+ attr.$removeClass(classString);
35812
35842
  }
35813
35843
 
35814
- function digestClassCounts(classes, count) {
35815
- // Use createMap() to prevent class assumptions involving property
35816
- // names in Object.prototype
35817
- var classCounts = element.data('$classCounts') || createMap();
35844
+ function updateClasses(oldClassString, newClassString) {
35845
+ var oldClassArray = split(oldClassString);
35846
+ var newClassArray = split(newClassString);
35847
+
35848
+ var toRemoveArray = arrayDifference(oldClassArray, newClassArray);
35849
+ var toAddArray = arrayDifference(newClassArray, oldClassArray);
35850
+
35851
+ var toRemoveString = digestClassCounts(toRemoveArray, -1);
35852
+ var toAddString = digestClassCounts(toAddArray, 1);
35853
+
35854
+ attr.$addClass(toAddString);
35855
+ attr.$removeClass(toRemoveString);
35856
+ }
35857
+
35858
+ function digestClassCounts(classArray, count) {
35818
35859
  var classesToUpdate = [];
35819
- forEach(classes, function(className) {
35860
+
35861
+ forEach(classArray, function(className) {
35820
35862
  if (count > 0 || classCounts[className]) {
35821
35863
  classCounts[className] = (classCounts[className] || 0) + count;
35822
35864
  if (classCounts[className] === +(count > 0)) {
@@ -35824,77 +35866,106 @@ function classDirective(name, selector) {
35824
35866
  }
35825
35867
  }
35826
35868
  });
35827
- element.data('$classCounts', classCounts);
35869
+
35828
35870
  return classesToUpdate.join(' ');
35829
35871
  }
35830
35872
 
35831
- function updateClasses(oldClasses, newClasses) {
35832
- var toAdd = arrayDifference(newClasses, oldClasses);
35833
- var toRemove = arrayDifference(oldClasses, newClasses);
35834
- toAdd = digestClassCounts(toAdd, 1);
35835
- toRemove = digestClassCounts(toRemove, -1);
35836
- if (toAdd && toAdd.length) {
35837
- $animate.addClass(element, toAdd);
35838
- }
35839
- if (toRemove && toRemove.length) {
35840
- $animate.removeClass(element, toRemove);
35873
+ function ngClassIndexWatchAction(newModulo) {
35874
+ // This watch-action should run before the `ngClass[OneTime]WatchAction()`, thus it
35875
+ // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the
35876
+ // `ngClass[OneTime]WatchAction()` will update the classes.
35877
+ if (newModulo === selector) {
35878
+ addClasses(oldClassString);
35879
+ } else {
35880
+ removeClasses(oldClassString);
35841
35881
  }
35882
+
35883
+ oldModulo = newModulo;
35842
35884
  }
35843
35885
 
35844
- function ngClassWatchAction(newVal) {
35845
- // eslint-disable-next-line no-bitwise
35846
- if (selector === true || (scope.$index & 1) === selector) {
35847
- var newClasses = arrayClasses(newVal || []);
35848
- if (!oldVal) {
35849
- addClasses(newClasses);
35850
- } else if (!equals(newVal,oldVal)) {
35851
- var oldClasses = arrayClasses(oldVal);
35852
- updateClasses(oldClasses, newClasses);
35853
- }
35886
+ function ngClassOneTimeWatchAction(newClassValue) {
35887
+ var newClassString = toClassString(newClassValue);
35888
+
35889
+ if (newClassString !== oldClassString) {
35890
+ ngClassWatchAction(newClassString);
35854
35891
  }
35855
- if (isArray(newVal)) {
35856
- oldVal = newVal.map(function(v) { return shallowCopy(v); });
35857
- } else {
35858
- oldVal = shallowCopy(newVal);
35892
+ }
35893
+
35894
+ function ngClassWatchAction(newClassString) {
35895
+ if (oldModulo === selector) {
35896
+ updateClasses(oldClassString, newClassString);
35859
35897
  }
35898
+
35899
+ oldClassString = newClassString;
35860
35900
  }
35861
35901
  }
35862
35902
  };
35903
+ }];
35863
35904
 
35864
- function arrayDifference(tokens1, tokens2) {
35865
- var values = [];
35905
+ // Helpers
35906
+ function arrayDifference(tokens1, tokens2) {
35907
+ if (!tokens1 || !tokens1.length) return [];
35908
+ if (!tokens2 || !tokens2.length) return tokens1;
35866
35909
 
35867
- outer:
35868
- for (var i = 0; i < tokens1.length; i++) {
35869
- var token = tokens1[i];
35870
- for (var j = 0; j < tokens2.length; j++) {
35871
- if (token === tokens2[j]) continue outer;
35872
- }
35873
- values.push(token);
35910
+ var values = [];
35911
+
35912
+ outer:
35913
+ for (var i = 0; i < tokens1.length; i++) {
35914
+ var token = tokens1[i];
35915
+ for (var j = 0; j < tokens2.length; j++) {
35916
+ if (token === tokens2[j]) continue outer;
35874
35917
  }
35875
- return values;
35918
+ values.push(token);
35876
35919
  }
35877
35920
 
35878
- function arrayClasses(classVal) {
35879
- var classes = [];
35880
- if (isArray(classVal)) {
35881
- forEach(classVal, function(v) {
35882
- classes = classes.concat(arrayClasses(v));
35883
- });
35884
- return classes;
35885
- } else if (isString(classVal)) {
35886
- return classVal.split(' ');
35887
- } else if (isObject(classVal)) {
35888
- forEach(classVal, function(v, k) {
35889
- if (v) {
35890
- classes = classes.concat(k.split(' '));
35891
- }
35892
- });
35893
- return classes;
35921
+ return values;
35922
+ }
35923
+
35924
+ function split(classString) {
35925
+ return classString && classString.split(' ');
35926
+ }
35927
+
35928
+ function toClassString(classValue) {
35929
+ var classString = classValue;
35930
+
35931
+ if (isArray(classValue)) {
35932
+ classString = classValue.map(toClassString).join(' ');
35933
+ } else if (isObject(classValue)) {
35934
+ classString = Object.keys(classValue).
35935
+ filter(function(key) { return classValue[key]; }).
35936
+ join(' ');
35937
+ }
35938
+
35939
+ return classString;
35940
+ }
35941
+
35942
+ function toFlatValue(classValue) {
35943
+ var flatValue = classValue;
35944
+
35945
+ if (isArray(classValue)) {
35946
+ flatValue = classValue.map(toFlatValue);
35947
+ } else if (isObject(classValue)) {
35948
+ var hasUndefined = false;
35949
+
35950
+ flatValue = Object.keys(classValue).filter(function(key) {
35951
+ var value = classValue[key];
35952
+
35953
+ if (!hasUndefined && isUndefined(value)) {
35954
+ hasUndefined = true;
35955
+ }
35956
+
35957
+ return value;
35958
+ });
35959
+
35960
+ if (hasUndefined) {
35961
+ // Prevent the `oneTimeLiteralWatchInterceptor` from unregistering
35962
+ // the watcher, by including at least one `undefined` value.
35963
+ flatValue.push(undefined);
35894
35964
  }
35895
- return classVal;
35896
35965
  }
35897
- }];
35966
+
35967
+ return flatValue;
35968
+ }
35898
35969
  }
35899
35970
 
35900
35971
  /**
@@ -39284,19 +39355,27 @@ defaultModelOptions = new ModelOptions({
39284
39355
  *
39285
39356
  */
39286
39357
  var ngModelOptionsDirective = function() {
39358
+ NgModelOptionsController.$inject = ['$attrs', '$scope'];
39359
+ function NgModelOptionsController($attrs, $scope) {
39360
+ this.$$attrs = $attrs;
39361
+ this.$$scope = $scope;
39362
+ }
39363
+ NgModelOptionsController.prototype = {
39364
+ $onInit: function() {
39365
+ var parentOptions = this.parentCtrl ? this.parentCtrl.$options : defaultModelOptions;
39366
+ var modelOptionsDefinition = this.$$scope.$eval(this.$$attrs.ngModelOptions);
39367
+
39368
+ this.$options = parentOptions.createChild(modelOptionsDefinition);
39369
+ }
39370
+ };
39371
+
39287
39372
  return {
39288
39373
  restrict: 'A',
39289
39374
  // ngModelOptions needs to run before ngModel and input directives
39290
39375
  priority: 10,
39291
- require: ['ngModelOptions', '?^^ngModelOptions'],
39292
- controller: function NgModelOptionsController() {},
39293
- link: {
39294
- pre: function ngModelOptionsPreLinkFn(scope, element, attrs, ctrls) {
39295
- var optionsCtrl = ctrls[0];
39296
- var parentOptions = ctrls[1] ? ctrls[1].$options : defaultModelOptions;
39297
- optionsCtrl.$options = parentOptions.createChild(scope.$eval(attrs.ngModelOptions));
39298
- }
39299
- }
39376
+ require: {parentCtrl: '?^^ngModelOptions'},
39377
+ bindToController: true,
39378
+ controller: NgModelOptionsController
39300
39379
  };
39301
39380
  };
39302
39381
 
@@ -39849,17 +39928,17 @@ var ngOptionsDirective = ['$compile', '$document', '$parse', function($compile,
39849
39928
 
39850
39929
  } else {
39851
39930
 
39852
- selectCtrl.writeValue = function writeNgOptionsMultiple(value) {
39931
+ selectCtrl.writeValue = function writeNgOptionsMultiple(values) {
39932
+ // Only set `<option>.selected` if necessary, in order to prevent some browsers from
39933
+ // scrolling to `<option>` elements that are outside the `<select>` element's viewport.
39934
+
39935
+ var selectedOptions = values && values.map(getAndUpdateSelectedOption) || [];
39936
+
39853
39937
  options.items.forEach(function(option) {
39854
- option.element.selected = false;
39938
+ if (option.element.selected && !includes(selectedOptions, option)) {
39939
+ option.element.selected = false;
39940
+ }
39855
39941
  });
39856
-
39857
- if (value) {
39858
- value.forEach(function(item) {
39859
- var option = options.getOptionFromViewValue(item);
39860
- if (option) option.element.selected = true;
39861
- });
39862
- }
39863
39942
  };
39864
39943
 
39865
39944
 
@@ -39949,6 +40028,14 @@ var ngOptionsDirective = ['$compile', '$document', '$parse', function($compile,
39949
40028
  updateOptionElement(option, optionElement);
39950
40029
  }
39951
40030
 
40031
+ function getAndUpdateSelectedOption(viewValue) {
40032
+ var option = options.getOptionFromViewValue(viewValue);
40033
+ var element = option && option.element;
40034
+
40035
+ if (element && !element.selected) element.selected = true;
40036
+
40037
+ return option;
40038
+ }
39952
40039
 
39953
40040
  function updateOptionElement(option, element) {
39954
40041
  option.element = element;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.6.0
2
+ * @license AngularJS v1.6.1
3
3
  * (c) 2010-2016 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -57,7 +57,7 @@ function minErr(module, ErrorConstructor) {
57
57
  return match;
58
58
  });
59
59
 
60
- message += '\nhttp://errors.angularjs.org/1.6.0/' +
60
+ message += '\nhttp://errors.angularjs.org/1.6.1/' +
61
61
  (module ? module + '/' : '') + code;
62
62
 
63
63
  for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
@@ -2623,11 +2623,11 @@ function toDebugString(obj) {
2623
2623
  var version = {
2624
2624
  // These placeholder strings will be replaced by grunt's `build` task.
2625
2625
  // They need to be double- or single-quoted.
2626
- full: '1.6.0',
2626
+ full: '1.6.1',
2627
2627
  major: 1,
2628
2628
  minor: 6,
2629
- dot: 0,
2630
- codeName: 'rainbow-tsunami'
2629
+ dot: 1,
2630
+ codeName: 'promise-rectification'
2631
2631
  };
2632
2632
 
2633
2633
 
@@ -3753,12 +3753,15 @@ forEach({
3753
3753
 
3754
3754
  after: function(element, newElement) {
3755
3755
  var index = element, parent = element.parentNode;
3756
- newElement = new JQLite(newElement);
3757
3756
 
3758
- for (var i = 0, ii = newElement.length; i < ii; i++) {
3759
- var node = newElement[i];
3760
- parent.insertBefore(node, index.nextSibling);
3761
- index = node;
3757
+ if (parent) {
3758
+ newElement = new JQLite(newElement);
3759
+
3760
+ for (var i = 0, ii = newElement.length; i < ii; i++) {
3761
+ var node = newElement[i];
3762
+ parent.insertBefore(node, index.nextSibling);
3763
+ index = node;
3764
+ }
3762
3765
  }
3763
3766
  },
3764
3767
 
@@ -12893,7 +12896,8 @@ function $IntervalProvider() {
12893
12896
  * appropriate moment. See the example below for more details on how and when to do this.
12894
12897
  * </div>
12895
12898
  *
12896
- * @param {function()} fn A function that should be called repeatedly.
12899
+ * @param {function()} fn A function that should be called repeatedly. If no additional arguments
12900
+ * are passed (see below), the function is called with the current iteration count.
12897
12901
  * @param {number} delay Number of milliseconds between each function call.
12898
12902
  * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat
12899
12903
  * indefinitely.
@@ -16524,6 +16528,7 @@ function $QProvider() {
16524
16528
  *
16525
16529
  * @description
16526
16530
  * Retrieves or overrides whether to generate an error when a rejected promise is not handled.
16531
+ * This feature is enabled by default.
16527
16532
  *
16528
16533
  * @param {boolean=} value Whether to generate an error when a rejected promise is not handled.
16529
16534
  * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for
@@ -16665,7 +16670,11 @@ function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
16665
16670
  if (!toCheck.pur) {
16666
16671
  toCheck.pur = true;
16667
16672
  var errorMessage = 'Possibly unhandled rejection: ' + toDebugString(toCheck.value);
16668
- exceptionHandler(errorMessage);
16673
+ if (toCheck.value instanceof Error) {
16674
+ exceptionHandler(toCheck.value, errorMessage);
16675
+ } else {
16676
+ exceptionHandler(errorMessage);
16677
+ }
16669
16678
  }
16670
16679
  }
16671
16680
  }
@@ -17399,15 +17408,21 @@ function $RootScopeProvider() {
17399
17408
 
17400
17409
  if (!array) {
17401
17410
  array = scope.$$watchers = [];
17411
+ array.$$digestWatchIndex = -1;
17402
17412
  }
17403
17413
  // we use unshift since we use a while loop in $digest for speed.
17404
17414
  // the while loop reads in reverse order.
17405
17415
  array.unshift(watcher);
17416
+ array.$$digestWatchIndex++;
17406
17417
  incrementWatchersCount(this, 1);
17407
17418
 
17408
17419
  return function deregisterWatch() {
17409
- if (arrayRemove(array, watcher) >= 0) {
17420
+ var index = arrayRemove(array, watcher);
17421
+ if (index >= 0) {
17410
17422
  incrementWatchersCount(scope, -1);
17423
+ if (index < array.$$digestWatchIndex) {
17424
+ array.$$digestWatchIndex--;
17425
+ }
17411
17426
  }
17412
17427
  lastDirtyWatch = null;
17413
17428
  };
@@ -17740,7 +17755,6 @@ function $RootScopeProvider() {
17740
17755
  $digest: function() {
17741
17756
  var watch, value, last, fn, get,
17742
17757
  watchers,
17743
- length,
17744
17758
  dirty, ttl = TTL,
17745
17759
  next, current, target = this,
17746
17760
  watchLog = [],
@@ -17781,10 +17795,10 @@ function $RootScopeProvider() {
17781
17795
  do { // "traverse the scopes" loop
17782
17796
  if ((watchers = current.$$watchers)) {
17783
17797
  // process our watches
17784
- length = watchers.length;
17785
- while (length--) {
17798
+ watchers.$$digestWatchIndex = watchers.length;
17799
+ while (watchers.$$digestWatchIndex--) {
17786
17800
  try {
17787
- watch = watchers[length];
17801
+ watch = watchers[watchers.$$digestWatchIndex];
17788
17802
  // Most common watches are on primitives, in which case we can short
17789
17803
  // circuit it with === operator, only when === fails do we use .equals
17790
17804
  if (watch) {
@@ -20101,6 +20115,14 @@ function $$CookieReader($document) {
20101
20115
  var lastCookies = {};
20102
20116
  var lastCookieString = '';
20103
20117
 
20118
+ function safeGetCookie(rawDocument) {
20119
+ try {
20120
+ return rawDocument.cookie || '';
20121
+ } catch (e) {
20122
+ return '';
20123
+ }
20124
+ }
20125
+
20104
20126
  function safeDecodeURIComponent(str) {
20105
20127
  try {
20106
20128
  return decodeURIComponent(str);
@@ -20111,7 +20133,7 @@ function $$CookieReader($document) {
20111
20133
 
20112
20134
  return function() {
20113
20135
  var cookieArray, cookie, i, index, name;
20114
- var currentCookieString = rawDocument.cookie || '';
20136
+ var currentCookieString = safeGetCookie(rawDocument);
20115
20137
 
20116
20138
  if (currentCookieString !== lastCookieString) {
20117
20139
  lastCookieString = currentCookieString;
@@ -25699,51 +25721,71 @@ var ngChangeDirective = valueFn({
25699
25721
 
25700
25722
  function classDirective(name, selector) {
25701
25723
  name = 'ngClass' + name;
25702
- return ['$animate', function($animate) {
25724
+ var indexWatchExpression;
25725
+
25726
+ return ['$parse', function($parse) {
25703
25727
  return {
25704
25728
  restrict: 'AC',
25705
25729
  link: function(scope, element, attr) {
25706
- var oldVal;
25730
+ var expression = attr[name].trim();
25731
+ var isOneTime = (expression.charAt(0) === ':') && (expression.charAt(1) === ':');
25707
25732
 
25708
- scope.$watch(attr[name], ngClassWatchAction, true);
25733
+ var watchInterceptor = isOneTime ? toFlatValue : toClassString;
25734
+ var watchExpression = $parse(expression, watchInterceptor);
25735
+ var watchAction = isOneTime ? ngClassOneTimeWatchAction : ngClassWatchAction;
25709
25736
 
25710
- attr.$observe('class', function(value) {
25711
- ngClassWatchAction(scope.$eval(attr[name]));
25712
- });
25737
+ var classCounts = element.data('$classCounts');
25738
+ var oldModulo = true;
25739
+ var oldClassString;
25713
25740
 
25741
+ if (!classCounts) {
25742
+ // Use createMap() to prevent class assumptions involving property
25743
+ // names in Object.prototype
25744
+ classCounts = createMap();
25745
+ element.data('$classCounts', classCounts);
25746
+ }
25714
25747
 
25715
25748
  if (name !== 'ngClass') {
25716
- scope.$watch('$index', function($index, old$index) {
25717
- /* eslint-disable no-bitwise */
25718
- var mod = $index & 1;
25719
- if (mod !== (old$index & 1)) {
25720
- var classes = arrayClasses(scope.$eval(attr[name]));
25721
- if (mod === selector) {
25722
- addClasses(classes);
25723
- } else {
25724
- removeClasses(classes);
25725
- }
25726
- }
25727
- /* eslint-enable */
25728
- });
25749
+ if (!indexWatchExpression) {
25750
+ indexWatchExpression = $parse('$index', function moduloTwo($index) {
25751
+ // eslint-disable-next-line no-bitwise
25752
+ return $index & 1;
25753
+ });
25754
+ }
25755
+
25756
+ scope.$watch(indexWatchExpression, ngClassIndexWatchAction);
25729
25757
  }
25730
25758
 
25731
- function addClasses(classes) {
25732
- var newClasses = digestClassCounts(classes, 1);
25733
- attr.$addClass(newClasses);
25759
+ scope.$watch(watchExpression, watchAction, isOneTime);
25760
+
25761
+ function addClasses(classString) {
25762
+ classString = digestClassCounts(split(classString), 1);
25763
+ attr.$addClass(classString);
25734
25764
  }
25735
25765
 
25736
- function removeClasses(classes) {
25737
- var newClasses = digestClassCounts(classes, -1);
25738
- attr.$removeClass(newClasses);
25766
+ function removeClasses(classString) {
25767
+ classString = digestClassCounts(split(classString), -1);
25768
+ attr.$removeClass(classString);
25739
25769
  }
25740
25770
 
25741
- function digestClassCounts(classes, count) {
25742
- // Use createMap() to prevent class assumptions involving property
25743
- // names in Object.prototype
25744
- var classCounts = element.data('$classCounts') || createMap();
25771
+ function updateClasses(oldClassString, newClassString) {
25772
+ var oldClassArray = split(oldClassString);
25773
+ var newClassArray = split(newClassString);
25774
+
25775
+ var toRemoveArray = arrayDifference(oldClassArray, newClassArray);
25776
+ var toAddArray = arrayDifference(newClassArray, oldClassArray);
25777
+
25778
+ var toRemoveString = digestClassCounts(toRemoveArray, -1);
25779
+ var toAddString = digestClassCounts(toAddArray, 1);
25780
+
25781
+ attr.$addClass(toAddString);
25782
+ attr.$removeClass(toRemoveString);
25783
+ }
25784
+
25785
+ function digestClassCounts(classArray, count) {
25745
25786
  var classesToUpdate = [];
25746
- forEach(classes, function(className) {
25787
+
25788
+ forEach(classArray, function(className) {
25747
25789
  if (count > 0 || classCounts[className]) {
25748
25790
  classCounts[className] = (classCounts[className] || 0) + count;
25749
25791
  if (classCounts[className] === +(count > 0)) {
@@ -25751,77 +25793,106 @@ function classDirective(name, selector) {
25751
25793
  }
25752
25794
  }
25753
25795
  });
25754
- element.data('$classCounts', classCounts);
25796
+
25755
25797
  return classesToUpdate.join(' ');
25756
25798
  }
25757
25799
 
25758
- function updateClasses(oldClasses, newClasses) {
25759
- var toAdd = arrayDifference(newClasses, oldClasses);
25760
- var toRemove = arrayDifference(oldClasses, newClasses);
25761
- toAdd = digestClassCounts(toAdd, 1);
25762
- toRemove = digestClassCounts(toRemove, -1);
25763
- if (toAdd && toAdd.length) {
25764
- $animate.addClass(element, toAdd);
25765
- }
25766
- if (toRemove && toRemove.length) {
25767
- $animate.removeClass(element, toRemove);
25800
+ function ngClassIndexWatchAction(newModulo) {
25801
+ // This watch-action should run before the `ngClass[OneTime]WatchAction()`, thus it
25802
+ // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the
25803
+ // `ngClass[OneTime]WatchAction()` will update the classes.
25804
+ if (newModulo === selector) {
25805
+ addClasses(oldClassString);
25806
+ } else {
25807
+ removeClasses(oldClassString);
25768
25808
  }
25809
+
25810
+ oldModulo = newModulo;
25769
25811
  }
25770
25812
 
25771
- function ngClassWatchAction(newVal) {
25772
- // eslint-disable-next-line no-bitwise
25773
- if (selector === true || (scope.$index & 1) === selector) {
25774
- var newClasses = arrayClasses(newVal || []);
25775
- if (!oldVal) {
25776
- addClasses(newClasses);
25777
- } else if (!equals(newVal,oldVal)) {
25778
- var oldClasses = arrayClasses(oldVal);
25779
- updateClasses(oldClasses, newClasses);
25780
- }
25813
+ function ngClassOneTimeWatchAction(newClassValue) {
25814
+ var newClassString = toClassString(newClassValue);
25815
+
25816
+ if (newClassString !== oldClassString) {
25817
+ ngClassWatchAction(newClassString);
25781
25818
  }
25782
- if (isArray(newVal)) {
25783
- oldVal = newVal.map(function(v) { return shallowCopy(v); });
25784
- } else {
25785
- oldVal = shallowCopy(newVal);
25819
+ }
25820
+
25821
+ function ngClassWatchAction(newClassString) {
25822
+ if (oldModulo === selector) {
25823
+ updateClasses(oldClassString, newClassString);
25786
25824
  }
25825
+
25826
+ oldClassString = newClassString;
25787
25827
  }
25788
25828
  }
25789
25829
  };
25830
+ }];
25790
25831
 
25791
- function arrayDifference(tokens1, tokens2) {
25792
- var values = [];
25832
+ // Helpers
25833
+ function arrayDifference(tokens1, tokens2) {
25834
+ if (!tokens1 || !tokens1.length) return [];
25835
+ if (!tokens2 || !tokens2.length) return tokens1;
25793
25836
 
25794
- outer:
25795
- for (var i = 0; i < tokens1.length; i++) {
25796
- var token = tokens1[i];
25797
- for (var j = 0; j < tokens2.length; j++) {
25798
- if (token === tokens2[j]) continue outer;
25799
- }
25800
- values.push(token);
25837
+ var values = [];
25838
+
25839
+ outer:
25840
+ for (var i = 0; i < tokens1.length; i++) {
25841
+ var token = tokens1[i];
25842
+ for (var j = 0; j < tokens2.length; j++) {
25843
+ if (token === tokens2[j]) continue outer;
25801
25844
  }
25802
- return values;
25845
+ values.push(token);
25803
25846
  }
25804
25847
 
25805
- function arrayClasses(classVal) {
25806
- var classes = [];
25807
- if (isArray(classVal)) {
25808
- forEach(classVal, function(v) {
25809
- classes = classes.concat(arrayClasses(v));
25810
- });
25811
- return classes;
25812
- } else if (isString(classVal)) {
25813
- return classVal.split(' ');
25814
- } else if (isObject(classVal)) {
25815
- forEach(classVal, function(v, k) {
25816
- if (v) {
25817
- classes = classes.concat(k.split(' '));
25818
- }
25819
- });
25820
- return classes;
25848
+ return values;
25849
+ }
25850
+
25851
+ function split(classString) {
25852
+ return classString && classString.split(' ');
25853
+ }
25854
+
25855
+ function toClassString(classValue) {
25856
+ var classString = classValue;
25857
+
25858
+ if (isArray(classValue)) {
25859
+ classString = classValue.map(toClassString).join(' ');
25860
+ } else if (isObject(classValue)) {
25861
+ classString = Object.keys(classValue).
25862
+ filter(function(key) { return classValue[key]; }).
25863
+ join(' ');
25864
+ }
25865
+
25866
+ return classString;
25867
+ }
25868
+
25869
+ function toFlatValue(classValue) {
25870
+ var flatValue = classValue;
25871
+
25872
+ if (isArray(classValue)) {
25873
+ flatValue = classValue.map(toFlatValue);
25874
+ } else if (isObject(classValue)) {
25875
+ var hasUndefined = false;
25876
+
25877
+ flatValue = Object.keys(classValue).filter(function(key) {
25878
+ var value = classValue[key];
25879
+
25880
+ if (!hasUndefined && isUndefined(value)) {
25881
+ hasUndefined = true;
25882
+ }
25883
+
25884
+ return value;
25885
+ });
25886
+
25887
+ if (hasUndefined) {
25888
+ // Prevent the `oneTimeLiteralWatchInterceptor` from unregistering
25889
+ // the watcher, by including at least one `undefined` value.
25890
+ flatValue.push(undefined);
25821
25891
  }
25822
- return classVal;
25823
25892
  }
25824
- }];
25893
+
25894
+ return flatValue;
25895
+ }
25825
25896
  }
25826
25897
 
25827
25898
  /**
@@ -29211,19 +29282,27 @@ defaultModelOptions = new ModelOptions({
29211
29282
  *
29212
29283
  */
29213
29284
  var ngModelOptionsDirective = function() {
29285
+ NgModelOptionsController.$inject = ['$attrs', '$scope'];
29286
+ function NgModelOptionsController($attrs, $scope) {
29287
+ this.$$attrs = $attrs;
29288
+ this.$$scope = $scope;
29289
+ }
29290
+ NgModelOptionsController.prototype = {
29291
+ $onInit: function() {
29292
+ var parentOptions = this.parentCtrl ? this.parentCtrl.$options : defaultModelOptions;
29293
+ var modelOptionsDefinition = this.$$scope.$eval(this.$$attrs.ngModelOptions);
29294
+
29295
+ this.$options = parentOptions.createChild(modelOptionsDefinition);
29296
+ }
29297
+ };
29298
+
29214
29299
  return {
29215
29300
  restrict: 'A',
29216
29301
  // ngModelOptions needs to run before ngModel and input directives
29217
29302
  priority: 10,
29218
- require: ['ngModelOptions', '?^^ngModelOptions'],
29219
- controller: function NgModelOptionsController() {},
29220
- link: {
29221
- pre: function ngModelOptionsPreLinkFn(scope, element, attrs, ctrls) {
29222
- var optionsCtrl = ctrls[0];
29223
- var parentOptions = ctrls[1] ? ctrls[1].$options : defaultModelOptions;
29224
- optionsCtrl.$options = parentOptions.createChild(scope.$eval(attrs.ngModelOptions));
29225
- }
29226
- }
29303
+ require: {parentCtrl: '?^^ngModelOptions'},
29304
+ bindToController: true,
29305
+ controller: NgModelOptionsController
29227
29306
  };
29228
29307
  };
29229
29308
 
@@ -29776,17 +29855,17 @@ var ngOptionsDirective = ['$compile', '$document', '$parse', function($compile,
29776
29855
 
29777
29856
  } else {
29778
29857
 
29779
- selectCtrl.writeValue = function writeNgOptionsMultiple(value) {
29858
+ selectCtrl.writeValue = function writeNgOptionsMultiple(values) {
29859
+ // Only set `<option>.selected` if necessary, in order to prevent some browsers from
29860
+ // scrolling to `<option>` elements that are outside the `<select>` element's viewport.
29861
+
29862
+ var selectedOptions = values && values.map(getAndUpdateSelectedOption) || [];
29863
+
29780
29864
  options.items.forEach(function(option) {
29781
- option.element.selected = false;
29865
+ if (option.element.selected && !includes(selectedOptions, option)) {
29866
+ option.element.selected = false;
29867
+ }
29782
29868
  });
29783
-
29784
- if (value) {
29785
- value.forEach(function(item) {
29786
- var option = options.getOptionFromViewValue(item);
29787
- if (option) option.element.selected = true;
29788
- });
29789
- }
29790
29869
  };
29791
29870
 
29792
29871
 
@@ -29876,6 +29955,14 @@ var ngOptionsDirective = ['$compile', '$document', '$parse', function($compile,
29876
29955
  updateOptionElement(option, optionElement);
29877
29956
  }
29878
29957
 
29958
+ function getAndUpdateSelectedOption(viewValue) {
29959
+ var option = options.getOptionFromViewValue(viewValue);
29960
+ var element = option && option.element;
29961
+
29962
+ if (element && !element.selected) element.selected = true;
29963
+
29964
+ return option;
29965
+ }
29879
29966
 
29880
29967
  function updateOptionElement(option, element) {
29881
29968
  option.element = element;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angularjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hirav Gandhi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-17 00:00:00.000000000 Z
11
+ date: 2017-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake