angular-gem 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
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.6/angular-animate.js +2137 -0
  4. data/vendor/assets/javascripts/1.3.6/angular-aria.js +332 -0
  5. data/vendor/assets/javascripts/1.3.6/angular-cookies.js +206 -0
  6. data/vendor/assets/javascripts/1.3.6/angular-loader.js +405 -0
  7. data/vendor/assets/javascripts/1.3.6/angular-messages.js +400 -0
  8. data/vendor/assets/javascripts/1.3.6/angular-mocks.js +2382 -0
  9. data/vendor/assets/javascripts/1.3.6/angular-resource.js +667 -0
  10. data/vendor/assets/javascripts/1.3.6/angular-route.js +995 -0
  11. data/vendor/assets/javascripts/1.3.6/angular-sanitize.js +680 -0
  12. data/vendor/assets/javascripts/1.3.6/angular-scenario.js +37354 -0
  13. data/vendor/assets/javascripts/1.3.6/angular-touch.js +622 -0
  14. data/vendor/assets/javascripts/1.3.6/angular.js +26000 -0
  15. data/vendor/assets/javascripts/angular-animate.js +121 -120
  16. data/vendor/assets/javascripts/angular-aria.js +39 -28
  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 +7 -5
  21. data/vendor/assets/javascripts/angular-resource.js +1 -1
  22. data/vendor/assets/javascripts/angular-route.js +1 -2
  23. data/vendor/assets/javascripts/angular-sanitize.js +6 -4
  24. data/vendor/assets/javascripts/angular-scenario.js +282 -199
  25. data/vendor/assets/javascripts/angular-touch.js +1 -1
  26. data/vendor/assets/javascripts/angular.js +280 -197
  27. metadata +14 -2
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.3.5
2
+ * @license AngularJS v1.3.6
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.5
2
+ * @license AngularJS v1.3.6
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.5/' +
58
+ message = message + '\nhttp://errors.angularjs.org/1.3.6/' +
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.5
2
+ * @license AngularJS v1.3.6
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.5
2
+ * @license AngularJS v1.3.6
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1119,7 +1119,7 @@ angular.mock.dump = function(object) {
1119
1119
  ```
1120
1120
  */
1121
1121
  angular.mock.$HttpBackendProvider = function() {
1122
- this.$get = ['$rootScope', createHttpBackendMock];
1122
+ this.$get = ['$rootScope', '$timeout', createHttpBackendMock];
1123
1123
  };
1124
1124
 
1125
1125
  /**
@@ -1136,7 +1136,7 @@ angular.mock.$HttpBackendProvider = function() {
1136
1136
  * @param {Object=} $browser Auto-flushing enabled if specified
1137
1137
  * @return {Object} Instance of $httpBackend mock
1138
1138
  */
1139
- function createHttpBackendMock($rootScope, $delegate, $browser) {
1139
+ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
1140
1140
  var definitions = [],
1141
1141
  expectations = [],
1142
1142
  responses = [],
@@ -1166,7 +1166,9 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {
1166
1166
  }
1167
1167
 
1168
1168
  function wrapResponse(wrapped) {
1169
- if (!$browser && timeout && timeout.then) timeout.then(handleTimeout);
1169
+ if (!$browser && timeout) {
1170
+ timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);
1171
+ }
1170
1172
 
1171
1173
  return handleResponse;
1172
1174
 
@@ -2040,7 +2042,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
2040
2042
  */
2041
2043
  angular.mock.e2e = {};
2042
2044
  angular.mock.e2e.$httpBackendDecorator =
2043
- ['$rootScope', '$delegate', '$browser', createHttpBackendMock];
2045
+ ['$rootScope', '$timeout', '$delegate', '$browser', createHttpBackendMock];
2044
2046
 
2045
2047
 
2046
2048
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.3.5
2
+ * @license AngularJS v1.3.6
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.5
2
+ * @license AngularJS v1.3.6
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -788,7 +788,6 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
788
788
  .view-animate-container {
789
789
  position:relative;
790
790
  height:100px!important;
791
- position:relative;
792
791
  background:white;
793
792
  border:1px solid black;
794
793
  height:40px;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.3.5
2
+ * @license AngularJS v1.3.6
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -628,7 +628,7 @@ angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);
628
628
  */
629
629
  angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
630
630
  var LINKY_URL_REGEXP =
631
- /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/,
631
+ /((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"”’]/,
632
632
  MAILTO_REGEXP = /^mailto:/;
633
633
 
634
634
  return function(text, target) {
@@ -641,8 +641,10 @@ angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
641
641
  while ((match = raw.match(LINKY_URL_REGEXP))) {
642
642
  // We can not end in these as they are sometimes found at the end of the sentence
643
643
  url = match[0];
644
- // if we did not match ftp/http/mailto then assume mailto
645
- if (match[2] == match[3]) url = 'mailto:' + url;
644
+ // if we did not match ftp/http/www/mailto then assume mailto
645
+ if (!match[2] && !match[4]) {
646
+ url = (match[3] ? 'http://' : 'mailto:') + url;
647
+ }
646
648
  i = match.index;
647
649
  addText(raw.substr(0, i));
648
650
  addLink(url, match[0].replace(MAILTO_REGEXP, ''));
@@ -9190,7 +9190,7 @@ return jQuery;
9190
9190
  }));
9191
9191
 
9192
9192
  /**
9193
- * @license AngularJS v1.3.5
9193
+ * @license AngularJS v1.3.6
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.5/' +
9249
+ message = message + '\nhttp://errors.angularjs.org/1.3.6/' +
9250
9250
  (module ? module + '/' : '') + code;
9251
9251
  for (i = 2; i < arguments.length; i++) {
9252
9252
  message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
@@ -10220,12 +10220,16 @@ function toJsonReplacer(key, value) {
10220
10220
  * stripped since angular uses this notation internally.
10221
10221
  *
10222
10222
  * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
10223
- * @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace.
10223
+ * @param {boolean|number=} pretty If set to true, the JSON output will contain newlines and whitespace.
10224
+ * If set to an integer, the JSON output will contain that many spaces per indentation (the default is 2).
10224
10225
  * @returns {string|undefined} JSON-ified string representing `obj`.
10225
10226
  */
10226
10227
  function toJson(obj, pretty) {
10227
10228
  if (typeof obj === 'undefined') return undefined;
10228
- return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null);
10229
+ if (!isNumber(pretty)) {
10230
+ pretty = pretty ? 2 : null;
10231
+ }
10232
+ return JSON.stringify(obj, toJsonReplacer, pretty);
10229
10233
  }
10230
10234
 
10231
10235
 
@@ -11273,7 +11277,8 @@ function toDebugString(obj) {
11273
11277
  $TimeoutProvider,
11274
11278
  $$RAFProvider,
11275
11279
  $$AsyncCallbackProvider,
11276
- $WindowProvider
11280
+ $WindowProvider,
11281
+ $$jqLiteProvider
11277
11282
  */
11278
11283
 
11279
11284
 
@@ -11292,11 +11297,11 @@ function toDebugString(obj) {
11292
11297
  * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
11293
11298
  */
11294
11299
  var version = {
11295
- full: '1.3.5', // all of these placeholder strings will be replaced by grunt's
11300
+ full: '1.3.6', // all of these placeholder strings will be replaced by grunt's
11296
11301
  major: 1, // package task
11297
11302
  minor: 3,
11298
- dot: 5,
11299
- codeName: 'cybernetic-mercantilism'
11303
+ dot: 6,
11304
+ codeName: 'robofunky-danceblaster'
11300
11305
  };
11301
11306
 
11302
11307
 
@@ -11426,7 +11431,8 @@ function publishExternalAPI(angular) {
11426
11431
  $timeout: $TimeoutProvider,
11427
11432
  $window: $WindowProvider,
11428
11433
  $$rAF: $$RAFProvider,
11429
- $$asyncCallback: $$AsyncCallbackProvider
11434
+ $$asyncCallback: $$AsyncCallbackProvider,
11435
+ $$jqLite: $$jqLiteProvider
11430
11436
  });
11431
11437
  }
11432
11438
  ]);
@@ -12436,6 +12442,27 @@ forEach({
12436
12442
  JQLite.prototype.unbind = JQLite.prototype.off;
12437
12443
  });
12438
12444
 
12445
+
12446
+ // Provider for private $$jqLite service
12447
+ function $$jqLiteProvider() {
12448
+ this.$get = function $$jqLite() {
12449
+ return extend(JQLite, {
12450
+ hasClass: function(node, classes) {
12451
+ if (node.attr) node = node[0];
12452
+ return jqLiteHasClass(node, classes);
12453
+ },
12454
+ addClass: function(node, classes) {
12455
+ if (node.attr) node = node[0];
12456
+ return jqLiteAddClass(node, classes);
12457
+ },
12458
+ removeClass: function(node, classes) {
12459
+ if (node.attr) node = node[0];
12460
+ return jqLiteRemoveClass(node, classes);
12461
+ }
12462
+ });
12463
+ };
12464
+ }
12465
+
12439
12466
  /**
12440
12467
  * Computes a hash of an 'obj'.
12441
12468
  * Hash of a:
@@ -12688,6 +12715,7 @@ function annotate(fn, strictDi, name) {
12688
12715
  * Return an instance of the service.
12689
12716
  *
12690
12717
  * @param {string} name The name of the instance to retrieve.
12718
+ * @param {string} caller An optional string to provide the origin of the function call for error messages.
12691
12719
  * @return {*} The instance.
12692
12720
  */
12693
12721
 
@@ -13138,14 +13166,17 @@ function createInjector(modulesToLoad, strictDi) {
13138
13166
  }
13139
13167
  },
13140
13168
  providerInjector = (providerCache.$injector =
13141
- createInternalInjector(providerCache, function() {
13169
+ createInternalInjector(providerCache, function(serviceName, caller) {
13170
+ if (angular.isString(caller)) {
13171
+ path.push(caller);
13172
+ }
13142
13173
  throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- '));
13143
13174
  })),
13144
13175
  instanceCache = {},
13145
13176
  instanceInjector = (instanceCache.$injector =
13146
- createInternalInjector(instanceCache, function(servicename) {
13147
- var provider = providerInjector.get(servicename + providerSuffix);
13148
- return instanceInjector.invoke(provider.$get, provider, undefined, servicename);
13177
+ createInternalInjector(instanceCache, function(serviceName, caller) {
13178
+ var provider = providerInjector.get(serviceName + providerSuffix, caller);
13179
+ return instanceInjector.invoke(provider.$get, provider, undefined, serviceName);
13149
13180
  }));
13150
13181
 
13151
13182
 
@@ -13180,7 +13211,7 @@ function createInjector(modulesToLoad, strictDi) {
13180
13211
 
13181
13212
  function enforceReturnValue(name, factory) {
13182
13213
  return function enforcedReturnValue() {
13183
- var result = instanceInjector.invoke(factory, this, undefined, name);
13214
+ var result = instanceInjector.invoke(factory, this);
13184
13215
  if (isUndefined(result)) {
13185
13216
  throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name);
13186
13217
  }
@@ -13275,7 +13306,7 @@ function createInjector(modulesToLoad, strictDi) {
13275
13306
 
13276
13307
  function createInternalInjector(cache, factory) {
13277
13308
 
13278
- function getService(serviceName) {
13309
+ function getService(serviceName, caller) {
13279
13310
  if (cache.hasOwnProperty(serviceName)) {
13280
13311
  if (cache[serviceName] === INSTANTIATING) {
13281
13312
  throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
@@ -13286,7 +13317,7 @@ function createInjector(modulesToLoad, strictDi) {
13286
13317
  try {
13287
13318
  path.unshift(serviceName);
13288
13319
  cache[serviceName] = INSTANTIATING;
13289
- return cache[serviceName] = factory(serviceName);
13320
+ return cache[serviceName] = factory(serviceName, caller);
13290
13321
  } catch (err) {
13291
13322
  if (cache[serviceName] === INSTANTIATING) {
13292
13323
  delete cache[serviceName];
@@ -13318,7 +13349,7 @@ function createInjector(modulesToLoad, strictDi) {
13318
13349
  args.push(
13319
13350
  locals && locals.hasOwnProperty(key)
13320
13351
  ? locals[key]
13321
- : getService(key)
13352
+ : getService(key, serviceName)
13322
13353
  );
13323
13354
  }
13324
13355
  if (isArray(fn)) {
@@ -14062,6 +14093,11 @@ function Browser(window, document, $log, $sniffer) {
14062
14093
  }
14063
14094
  }
14064
14095
 
14096
+ function getHash(url) {
14097
+ var index = url.indexOf('#');
14098
+ return index === -1 ? '' : url.substr(index + 1);
14099
+ }
14100
+
14065
14101
  /**
14066
14102
  * @private
14067
14103
  * Note: this method is used only by scenario runner
@@ -14191,8 +14227,10 @@ function Browser(window, document, $log, $sniffer) {
14191
14227
  }
14192
14228
  if (replace) {
14193
14229
  location.replace(url);
14194
- } else {
14230
+ } else if (!sameBase) {
14195
14231
  location.href = url;
14232
+ } else {
14233
+ location.hash = getHash(url);
14196
14234
  }
14197
14235
  }
14198
14236
  return self;
@@ -14971,7 +15009,7 @@ function $TemplateCacheProvider() {
14971
15009
  * #### `multiElement`
14972
15010
  * When this property is set to true, the HTML compiler will collect DOM nodes between
14973
15011
  * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them
14974
- * together as the directive elements. It is recomended that this feature be used on directives
15012
+ * together as the directive elements. It is recommended that this feature be used on directives
14975
15013
  * which are not strictly behavioural (such as {@link ngClick}), and which
14976
15014
  * do not manipulate or replace child nodes (such as {@link ngInclude}).
14977
15015
  *
@@ -15763,6 +15801,21 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
15763
15801
  };
15764
15802
 
15765
15803
  Attributes.prototype = {
15804
+ /**
15805
+ * @ngdoc method
15806
+ * @name $compile.directive.Attributes#$normalize
15807
+ * @kind function
15808
+ *
15809
+ * @description
15810
+ * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or
15811
+ * `data-`) to its normalized, camelCase form.
15812
+ *
15813
+ * Also there is special case for Moz prefix starting with upper case letter.
15814
+ *
15815
+ * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}
15816
+ *
15817
+ * @param {string} name Name to normalize
15818
+ */
15766
15819
  $normalize: directiveNormalize,
15767
15820
 
15768
15821
 
@@ -17341,13 +17394,6 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
17341
17394
  var PREFIX_REGEXP = /^((?:x|data)[\:\-_])/i;
17342
17395
  /**
17343
17396
  * Converts all accepted directives format into proper directive name.
17344
- * All of these will become 'myDirective':
17345
- * my:Directive
17346
- * my-directive
17347
- * x-my-directive
17348
- * data-my:directive
17349
- *
17350
- * Also there is special case for Moz prefix starting with upper case letter.
17351
17397
  * @param name Name to normalize
17352
17398
  */
17353
17399
  function directiveNormalize(name) {
@@ -18700,8 +18746,7 @@ function $HttpProvider() {
18700
18746
  if (isDefined(cachedResp)) {
18701
18747
  if (isPromiseLike(cachedResp)) {
18702
18748
  // cached request has already been sent, but there is no response yet
18703
- cachedResp.then(removePendingReq, removePendingReq);
18704
- return cachedResp;
18749
+ cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);
18705
18750
  } else {
18706
18751
  // serving from cache
18707
18752
  if (isArray(cachedResp)) {
@@ -18779,6 +18824,9 @@ function $HttpProvider() {
18779
18824
  });
18780
18825
  }
18781
18826
 
18827
+ function resolvePromiseWithResult(result) {
18828
+ resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);
18829
+ }
18782
18830
 
18783
18831
  function removePendingReq() {
18784
18832
  var idx = $http.pendingRequests.indexOf(config);
@@ -19390,33 +19438,33 @@ function $IntervalProvider() {
19390
19438
  * // Don't start a new fight if we are already fighting
19391
19439
  * if ( angular.isDefined(stop) ) return;
19392
19440
  *
19393
- * stop = $interval(function() {
19394
- * if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {
19395
- * $scope.blood_1 = $scope.blood_1 - 3;
19396
- * $scope.blood_2 = $scope.blood_2 - 4;
19397
- * } else {
19398
- * $scope.stopFight();
19399
- * }
19400
- * }, 100);
19401
- * };
19441
+ * stop = $interval(function() {
19442
+ * if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {
19443
+ * $scope.blood_1 = $scope.blood_1 - 3;
19444
+ * $scope.blood_2 = $scope.blood_2 - 4;
19445
+ * } else {
19446
+ * $scope.stopFight();
19447
+ * }
19448
+ * }, 100);
19449
+ * };
19402
19450
  *
19403
- * $scope.stopFight = function() {
19404
- * if (angular.isDefined(stop)) {
19405
- * $interval.cancel(stop);
19406
- * stop = undefined;
19407
- * }
19408
- * };
19451
+ * $scope.stopFight = function() {
19452
+ * if (angular.isDefined(stop)) {
19453
+ * $interval.cancel(stop);
19454
+ * stop = undefined;
19455
+ * }
19456
+ * };
19409
19457
  *
19410
- * $scope.resetFight = function() {
19411
- * $scope.blood_1 = 100;
19412
- * $scope.blood_2 = 120;
19413
- * };
19458
+ * $scope.resetFight = function() {
19459
+ * $scope.blood_1 = 100;
19460
+ * $scope.blood_2 = 120;
19461
+ * };
19414
19462
  *
19415
- * $scope.$on('$destroy', function() {
19416
- * // Make sure that the interval is destroyed too
19417
- * $scope.stopFight();
19418
- * });
19419
- * }])
19463
+ * $scope.$on('$destroy', function() {
19464
+ * // Make sure that the interval is destroyed too
19465
+ * $scope.stopFight();
19466
+ * });
19467
+ * }])
19420
19468
  * // Register the 'myCurrentTime' directive factory method.
19421
19469
  * // We inject $interval and dateFilter service since the factory method is DI.
19422
19470
  * .directive('myCurrentTime', ['$interval', 'dateFilter',
@@ -19659,6 +19707,10 @@ function stripHash(url) {
19659
19707
  return index == -1 ? url : url.substr(0, index);
19660
19708
  }
19661
19709
 
19710
+ function trimEmptyHash(url) {
19711
+ return url.replace(/(#.+)|#$/, '$1');
19712
+ }
19713
+
19662
19714
 
19663
19715
  function stripFile(url) {
19664
19716
  return url.substr(0, stripHash(url).lastIndexOf('/') + 1);
@@ -19770,16 +19822,25 @@ function LocationHashbangUrl(appBase, hashPrefix) {
19770
19822
  */
19771
19823
  this.$$parse = function(url) {
19772
19824
  var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);
19773
- var withoutHashUrl = withoutBaseUrl.charAt(0) == '#'
19774
- ? beginsWith(hashPrefix, withoutBaseUrl)
19775
- : (this.$$html5)
19776
- ? withoutBaseUrl
19777
- : '';
19825
+ var withoutHashUrl;
19826
+
19827
+ if (withoutBaseUrl.charAt(0) === '#') {
19828
+
19829
+ // The rest of the url starts with a hash so we have
19830
+ // got either a hashbang path or a plain hash fragment
19831
+ withoutHashUrl = beginsWith(hashPrefix, withoutBaseUrl);
19832
+ if (isUndefined(withoutHashUrl)) {
19833
+ // There was no hashbang prefix so we just have a hash fragment
19834
+ withoutHashUrl = withoutBaseUrl;
19835
+ }
19778
19836
 
19779
- if (!isString(withoutHashUrl)) {
19780
- throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url,
19781
- hashPrefix);
19837
+ } else {
19838
+ // There was no hashbang path nor hash fragment:
19839
+ // If we are in HTML5 mode we use what is left as the path;
19840
+ // Otherwise we ignore what is left
19841
+ withoutHashUrl = this.$$html5 ? withoutBaseUrl : '';
19782
19842
  }
19843
+
19783
19844
  parseAppUrl(withoutHashUrl, this);
19784
19845
 
19785
19846
  this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);
@@ -20142,7 +20203,7 @@ var locationPrototype = {
20142
20203
  *
20143
20204
  *
20144
20205
  * ```js
20145
- * // given url http://example.com/some/path?foo=bar&baz=xoxo#hashValue
20206
+ * // given url http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue
20146
20207
  * var hash = $location.hash();
20147
20208
  * // => "hashValue"
20148
20209
  * ```
@@ -20494,10 +20555,11 @@ function $LocationProvider() {
20494
20555
 
20495
20556
  // update browser
20496
20557
  $rootScope.$watch(function $locationWatch() {
20497
- var oldUrl = $browser.url();
20558
+ var oldUrl = trimEmptyHash($browser.url());
20559
+ var newUrl = trimEmptyHash($location.absUrl());
20498
20560
  var oldState = $browser.state();
20499
20561
  var currentReplace = $location.$$replace;
20500
- var urlOrStateChanged = oldUrl !== $location.absUrl() ||
20562
+ var urlOrStateChanged = oldUrl !== newUrl ||
20501
20563
  ($location.$$html5 && $sniffer.history && oldState !== $location.$$state);
20502
20564
 
20503
20565
  if (initializing || urlOrStateChanged) {
@@ -21300,8 +21362,8 @@ Parser.prototype = {
21300
21362
  logicalAND: function() {
21301
21363
  var left = this.equality();
21302
21364
  var token;
21303
- if ((token = this.expect('&&'))) {
21304
- left = this.binaryFn(left, token.text, this.logicalAND(), true);
21365
+ while ((token = this.expect('&&'))) {
21366
+ left = this.binaryFn(left, token.text, this.equality(), true);
21305
21367
  }
21306
21368
  return left;
21307
21369
  },
@@ -21309,8 +21371,8 @@ Parser.prototype = {
21309
21371
  equality: function() {
21310
21372
  var left = this.relational();
21311
21373
  var token;
21312
- if ((token = this.expect('==','!=','===','!=='))) {
21313
- left = this.binaryFn(left, token.text, this.equality());
21374
+ while ((token = this.expect('==','!=','===','!=='))) {
21375
+ left = this.binaryFn(left, token.text, this.relational());
21314
21376
  }
21315
21377
  return left;
21316
21378
  },
@@ -21318,8 +21380,8 @@ Parser.prototype = {
21318
21380
  relational: function() {
21319
21381
  var left = this.additive();
21320
21382
  var token;
21321
- if ((token = this.expect('<', '>', '<=', '>='))) {
21322
- left = this.binaryFn(left, token.text, this.relational());
21383
+ while ((token = this.expect('<', '>', '<=', '>='))) {
21384
+ left = this.binaryFn(left, token.text, this.additive());
21323
21385
  }
21324
21386
  return left;
21325
21387
  },
@@ -21411,7 +21473,7 @@ Parser.prototype = {
21411
21473
  var args = argsFn.length ? [] : null;
21412
21474
 
21413
21475
  return function $parseFunctionCall(scope, locals) {
21414
- var context = contextGetter ? contextGetter(scope, locals) : scope;
21476
+ var context = contextGetter ? contextGetter(scope, locals) : isDefined(contextGetter) ? undefined : scope;
21415
21477
  var fn = fnGetter(scope, locals, context) || noop;
21416
21478
 
21417
21479
  if (args) {
@@ -25066,7 +25128,9 @@ function $SnifferProvider() {
25066
25128
  // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have
25067
25129
  // it. In particular the event is not fired when backspace or delete key are pressed or
25068
25130
  // when cut operation is performed.
25069
- if (event == 'input' && msie == 9) return false;
25131
+ // IE10+ implements 'input' event but it erroneously fires under various situations,
25132
+ // e.g. when placeholder changes, or a form is focused.
25133
+ if (event === 'input' && msie <= 11) return false;
25070
25134
 
25071
25135
  if (isUndefined(eventSupport[event])) {
25072
25136
  var divElm = document.createElement('div');
@@ -25126,10 +25190,8 @@ function $TemplateRequestProvider() {
25126
25190
 
25127
25191
  return $http.get(tpl, httpOptions)
25128
25192
  .then(function(response) {
25129
- var html = response.data;
25130
25193
  self.totalPendingRequests--;
25131
- $templateCache.put(tpl, html);
25132
- return html;
25194
+ return response.data;
25133
25195
  }, handleError);
25134
25196
 
25135
25197
  function handleError(resp) {
@@ -25760,106 +25822,103 @@ function filterFilter() {
25760
25822
  return function(array, expression, comparator) {
25761
25823
  if (!isArray(array)) return array;
25762
25824
 
25763
- var comparatorType = typeof(comparator),
25764
- predicates = [];
25765
-
25766
- predicates.check = function(value, index) {
25767
- for (var j = 0; j < predicates.length; j++) {
25768
- if (!predicates[j](value, index)) {
25769
- return false;
25770
- }
25771
- }
25772
- return true;
25773
- };
25825
+ var predicateFn;
25826
+ var matchAgainstAnyProp;
25774
25827
 
25775
- if (comparatorType !== 'function') {
25776
- if (comparatorType === 'boolean' && comparator) {
25777
- comparator = function(obj, text) {
25778
- return angular.equals(obj, text);
25779
- };
25780
- } else {
25781
- comparator = function(obj, text) {
25782
- if (obj && text && typeof obj === 'object' && typeof text === 'object') {
25783
- for (var objKey in obj) {
25784
- if (objKey.charAt(0) !== '$' && hasOwnProperty.call(obj, objKey) &&
25785
- comparator(obj[objKey], text[objKey])) {
25786
- return true;
25787
- }
25788
- }
25789
- return false;
25790
- }
25791
- text = ('' + text).toLowerCase();
25792
- return ('' + obj).toLowerCase().indexOf(text) > -1;
25793
- };
25794
- }
25795
- }
25796
-
25797
- var search = function(obj, text) {
25798
- if (typeof text === 'string' && text.charAt(0) === '!') {
25799
- return !search(obj, text.substr(1));
25800
- }
25801
- switch (typeof obj) {
25802
- case 'boolean':
25803
- case 'number':
25804
- case 'string':
25805
- return comparator(obj, text);
25806
- case 'object':
25807
- switch (typeof text) {
25808
- case 'object':
25809
- return comparator(obj, text);
25810
- default:
25811
- for (var objKey in obj) {
25812
- if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) {
25813
- return true;
25814
- }
25815
- }
25816
- break;
25817
- }
25818
- return false;
25819
- case 'array':
25820
- for (var i = 0; i < obj.length; i++) {
25821
- if (search(obj[i], text)) {
25822
- return true;
25823
- }
25824
- }
25825
- return false;
25826
- default:
25827
- return false;
25828
- }
25829
- };
25830
25828
  switch (typeof expression) {
25829
+ case 'function':
25830
+ predicateFn = expression;
25831
+ break;
25831
25832
  case 'boolean':
25832
25833
  case 'number':
25833
25834
  case 'string':
25834
- // Set up expression object and fall through
25835
- expression = {$:expression};
25836
- // jshint -W086
25835
+ matchAgainstAnyProp = true;
25836
+ //jshint -W086
25837
25837
  case 'object':
25838
- // jshint +W086
25839
- for (var key in expression) {
25840
- (function(path) {
25841
- if (typeof expression[path] === 'undefined') return;
25842
- predicates.push(function(value) {
25843
- return search(path == '$' ? value : (value && value[path]), expression[path]);
25844
- });
25845
- })(key);
25846
- }
25847
- break;
25848
- case 'function':
25849
- predicates.push(expression);
25838
+ //jshint +W086
25839
+ predicateFn = createPredicateFn(expression, comparator, matchAgainstAnyProp);
25850
25840
  break;
25851
25841
  default:
25852
25842
  return array;
25853
25843
  }
25854
- var filtered = [];
25855
- for (var j = 0; j < array.length; j++) {
25856
- var value = array[j];
25857
- if (predicates.check(value, j)) {
25858
- filtered.push(value);
25844
+
25845
+ return array.filter(predicateFn);
25846
+ };
25847
+ }
25848
+
25849
+ // Helper functions for `filterFilter`
25850
+ function createPredicateFn(expression, comparator, matchAgainstAnyProp) {
25851
+ var predicateFn;
25852
+
25853
+ if (comparator === true) {
25854
+ comparator = equals;
25855
+ } else if (!isFunction(comparator)) {
25856
+ comparator = function(actual, expected) {
25857
+ if (isObject(actual) || isObject(expected)) {
25858
+ // Prevent an object to be considered equal to a string like `'[object'`
25859
+ return false;
25859
25860
  }
25860
- }
25861
- return filtered;
25861
+
25862
+ actual = lowercase('' + actual);
25863
+ expected = lowercase('' + expected);
25864
+ return actual.indexOf(expected) !== -1;
25865
+ };
25866
+ }
25867
+
25868
+ predicateFn = function(item) {
25869
+ return deepCompare(item, expression, comparator, matchAgainstAnyProp);
25862
25870
  };
25871
+
25872
+ return predicateFn;
25873
+ }
25874
+
25875
+ function deepCompare(actual, expected, comparator, matchAgainstAnyProp) {
25876
+ var actualType = typeof actual;
25877
+ var expectedType = typeof expected;
25878
+
25879
+ if ((expectedType === 'string') && (expected.charAt(0) === '!')) {
25880
+ return !deepCompare(actual, expected.substring(1), comparator, matchAgainstAnyProp);
25881
+ } else if (actualType === 'array') {
25882
+ // In case `actual` is an array, consider it a match
25883
+ // if ANY of it's items matches `expected`
25884
+ return actual.some(function(item) {
25885
+ return deepCompare(item, expected, comparator, matchAgainstAnyProp);
25886
+ });
25887
+ }
25888
+
25889
+ switch (actualType) {
25890
+ case 'object':
25891
+ var key;
25892
+ if (matchAgainstAnyProp) {
25893
+ for (key in actual) {
25894
+ if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator)) {
25895
+ return true;
25896
+ }
25897
+ }
25898
+ return false;
25899
+ } else if (expectedType === 'object') {
25900
+ for (key in expected) {
25901
+ var expectedVal = expected[key];
25902
+ if (isFunction(expectedVal)) {
25903
+ continue;
25904
+ }
25905
+
25906
+ var keyIsDollar = key === '$';
25907
+ var actualVal = keyIsDollar ? actual : actual[key];
25908
+ if (!deepCompare(actualVal, expectedVal, comparator, keyIsDollar)) {
25909
+ return false;
25910
+ }
25911
+ }
25912
+ return true;
25913
+ } else {
25914
+ return comparator(actual, expected);
25915
+ }
25916
+ break;
25917
+ case 'function':
25918
+ return false;
25919
+ default:
25920
+ return comparator(actual, expected);
25921
+ }
25863
25922
  }
25864
25923
 
25865
25924
  /**
@@ -26012,7 +26071,6 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
26012
26071
  if (numStr.indexOf('e') !== -1) {
26013
26072
  var match = numStr.match(/([\d\.]+)e(-?)(\d+)/);
26014
26073
  if (match && match[2] == '-' && match[3] > fractionSize + 1) {
26015
- numStr = '0';
26016
26074
  number = 0;
26017
26075
  } else {
26018
26076
  formatedText = numStr;
@@ -26033,10 +26091,6 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
26033
26091
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
26034
26092
  number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize);
26035
26093
 
26036
- if (number === 0) {
26037
- isNegative = false;
26038
- }
26039
-
26040
26094
  var fraction = ('' + number).split(DECIMAL_SEP);
26041
26095
  var whole = fraction[0];
26042
26096
  fraction = fraction[1] || '';
@@ -26069,12 +26123,16 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
26069
26123
 
26070
26124
  if (fractionSize && fractionSize !== "0") formatedText += decimalSep + fraction.substr(0, fractionSize);
26071
26125
  } else {
26072
-
26073
- if (fractionSize > 0 && number > -1 && number < 1) {
26126
+ if (fractionSize > 0 && number < 1) {
26074
26127
  formatedText = number.toFixed(fractionSize);
26128
+ number = parseFloat(formatedText);
26075
26129
  }
26076
26130
  }
26077
26131
 
26132
+ if (number === 0) {
26133
+ isNegative = false;
26134
+ }
26135
+
26078
26136
  parts.push(isNegative ? pattern.negPre : pattern.posPre,
26079
26137
  formatedText,
26080
26138
  isNegative ? pattern.negSuf : pattern.posSuf);
@@ -26364,25 +26422,31 @@ function dateFilter($locale) {
26364
26422
  * the binding is automatically converted to JSON.
26365
26423
  *
26366
26424
  * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.
26425
+ * @param {number=} spacing The number of spaces to use per indentation, defaults to 2.
26367
26426
  * @returns {string} JSON string.
26368
26427
  *
26369
26428
  *
26370
26429
  * @example
26371
26430
  <example>
26372
26431
  <file name="index.html">
26373
- <pre>{{ {'name':'value'} | json }}</pre>
26432
+ <pre id="default-spacing">{{ {'name':'value'} | json }}</pre>
26433
+ <pre id="custom-spacing">{{ {'name':'value'} | json:4 }}</pre>
26374
26434
  </file>
26375
26435
  <file name="protractor.js" type="protractor">
26376
26436
  it('should jsonify filtered objects', function() {
26377
- expect(element(by.binding("{'name':'value'}")).getText()).toMatch(/\{\n "name": ?"value"\n}/);
26437
+ expect(element(by.id('default-spacing')).getText()).toMatch(/\{\n "name": ?"value"\n}/);
26438
+ expect(element(by.id('custom-spacing')).getText()).toMatch(/\{\n "name": ?"value"\n}/);
26378
26439
  });
26379
26440
  </file>
26380
26441
  </example>
26381
26442
  *
26382
26443
  */
26383
26444
  function jsonFilter() {
26384
- return function(object) {
26385
- return toJson(object, true);
26445
+ return function(object, spacing) {
26446
+ if (isUndefined(spacing)) {
26447
+ spacing = 2;
26448
+ }
26449
+ return toJson(object, spacing);
26386
26450
  };
26387
26451
  }
26388
26452
 
@@ -26702,12 +26766,29 @@ function orderByFilter($parse) {
26702
26766
  function compare(v1, v2) {
26703
26767
  var t1 = typeof v1;
26704
26768
  var t2 = typeof v2;
26705
- if (t1 == t2) {
26706
- if (isDate(v1) && isDate(v2)) {
26707
- v1 = v1.valueOf();
26708
- v2 = v2.valueOf();
26709
- }
26710
- if (t1 == "string") {
26769
+ // Prepare values for Abstract Relational Comparison
26770
+ // (http://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5):
26771
+ // If the resulting values are identical, return 0 to prevent
26772
+ // incorrect re-ordering.
26773
+ if (t1 === t2 && t1 === "object") {
26774
+ // If types are both numbers, emulate abstract ToPrimitive() operation
26775
+ // in order to get primitive values suitable for comparison
26776
+ t1 = typeof (v1.valueOf ? v1 = v1.valueOf() : v1);
26777
+ t2 = typeof (v2.valueOf ? v2 = v2.valueOf() : v2);
26778
+ if (t1 === t2 && t1 === "object") {
26779
+ // Object.prototype.valueOf will return the original object, by
26780
+ // default. If we do not receive a primitive value, use ToString()
26781
+ // instead.
26782
+ t1 = typeof (v1.toString ? v1 = v1.toString() : v1);
26783
+ t2 = typeof (v2.toString ? v2 = v2.toString() : v2);
26784
+
26785
+ // If the end result of toString() for each item is the same, do not
26786
+ // perform relational comparison, and do not re-order objects.
26787
+ if (t1 === t2 && v1 === v2 || t1 === "object") return 0;
26788
+ }
26789
+ }
26790
+ if (t1 === t2) {
26791
+ if (t1 === "string") {
26711
26792
  v1 = v1.toLowerCase();
26712
26793
  v2 = v2.toLowerCase();
26713
26794
  }
@@ -28656,7 +28737,6 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
28656
28737
  }
28657
28738
 
28658
28739
  function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
28659
- var placeholder = element[0].placeholder, noevent = {};
28660
28740
  var type = lowercase(element[0].type);
28661
28741
 
28662
28742
  // In composition mode, users are still inputing intermediate text buffer,
@@ -28676,19 +28756,14 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
28676
28756
  }
28677
28757
 
28678
28758
  var listener = function(ev) {
28759
+ if (timeout) {
28760
+ $browser.defer.cancel(timeout);
28761
+ timeout = null;
28762
+ }
28679
28763
  if (composing) return;
28680
28764
  var value = element.val(),
28681
28765
  event = ev && ev.type;
28682
28766
 
28683
- // IE (11 and under) seem to emit an 'input' event if the placeholder value changes.
28684
- // We don't want to dirty the value when this happens, so we abort here. Unfortunately,
28685
- // IE also sends input events for other non-input-related things, (such as focusing on a
28686
- // form control), so this change is not entirely enough to solve this.
28687
- if (msie && (ev || noevent).type === 'input' && element[0].placeholder !== placeholder) {
28688
- placeholder = element[0].placeholder;
28689
- return;
28690
- }
28691
-
28692
28767
  // By default we will trim the value
28693
28768
  // If the attribute ng-trim exists we will avoid trimming
28694
28769
  // If input type is 'password', the value is never trimmed
@@ -28711,11 +28786,13 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
28711
28786
  } else {
28712
28787
  var timeout;
28713
28788
 
28714
- var deferListener = function(ev) {
28789
+ var deferListener = function(ev, input, origValue) {
28715
28790
  if (!timeout) {
28716
28791
  timeout = $browser.defer(function() {
28717
- listener(ev);
28718
28792
  timeout = null;
28793
+ if (!input || input.value !== origValue) {
28794
+ listener(ev);
28795
+ }
28719
28796
  });
28720
28797
  }
28721
28798
  };
@@ -28727,7 +28804,7 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
28727
28804
  // command modifiers arrows
28728
28805
  if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;
28729
28806
 
28730
- deferListener(event);
28807
+ deferListener(event, this, this.value);
28731
28808
  });
28732
28809
 
28733
28810
  // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it
@@ -29902,11 +29979,15 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
29902
29979
  var prevModelValue = ctrl.$modelValue;
29903
29980
  var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;
29904
29981
  ctrl.$$rawModelValue = modelValue;
29982
+
29905
29983
  if (allowInvalid) {
29906
29984
  ctrl.$modelValue = modelValue;
29907
29985
  writeToModelIfNeeded();
29908
29986
  }
29909
- ctrl.$$runValidators(parserValid, modelValue, viewValue, function(allValid) {
29987
+
29988
+ // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date.
29989
+ // This can happen if e.g. $setViewValue is called from inside a parser
29990
+ ctrl.$$runValidators(parserValid, modelValue, ctrl.$$lastCommittedViewValue, function(allValid) {
29910
29991
  if (!allowInvalid) {
29911
29992
  // Note: Don't check ctrl.$valid here, as we could have
29912
29993
  // external validators (e.g. calculated on the server),
@@ -34248,7 +34329,7 @@ var ngSwitchDefaultDirective = ngDirective({
34248
34329
  }]);
34249
34330
  </script>
34250
34331
  <div ng-controller="ExampleController">
34251
- <input ng-model="title"><br>
34332
+ <input ng-model="title"> <br/>
34252
34333
  <textarea ng-model="text"></textarea> <br/>
34253
34334
  <pane title="{{title}}">{{text}}</pane>
34254
34335
  </div>
@@ -34376,9 +34457,9 @@ var ngOptionsMinErr = minErr('ngOptions');
34376
34457
  * or property name (for object data sources) of the value within the collection. If a `track by` expression
34377
34458
  * is used, the result of that expression will be set as the value of the `option` and `select` elements.
34378
34459
  *
34379
- * ### `select as` with `trackexpr`
34460
+ * ### `select as` with `track by`
34380
34461
  *
34381
- * Using `select as` together with `trackexpr` is not recommended. Reasoning:
34462
+ * Using `select as` together with `track by` is not recommended. Reasoning:
34382
34463
  *
34383
34464
  * - Example: &lt;select ng-options="item.subItem as item.label for item in values track by item.id" ng-model="selected"&gt;
34384
34465
  * values: [{id: 1, label: 'aLabel', subItem: {name: 'aSubItem'}}, {id: 2, label: 'bLabel', subItem: {name: 'bSubItem'}}],
@@ -34403,8 +34484,10 @@ var ngOptionsMinErr = minErr('ngOptions');
34403
34484
  * * for array data sources:
34404
34485
  * * `label` **`for`** `value` **`in`** `array`
34405
34486
  * * `select` **`as`** `label` **`for`** `value` **`in`** `array`
34406
- * * `label` **`group by`** `group` **`for`** `value` **`in`** `array`
34407
- * * `select` **`as`** `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`
34487
+ * * `label` **`group by`** `group` **`for`** `value` **`in`** `array`
34488
+ * * `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`
34489
+ * * `label` **`for`** `value` **`in`** `array` | orderBy:`orderexpr` **`track by`** `trackexpr`
34490
+ * (for including a filter with `track by`)
34408
34491
  * * for object data sources:
34409
34492
  * * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
34410
34493
  * * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
@@ -36690,7 +36773,7 @@ angular.scenario.dsl('binding', function() {
36690
36773
  */
36691
36774
  angular.scenario.dsl('input', function() {
36692
36775
  var chain = {};
36693
- var supportInputEvent = 'oninput' in document.createElement('div') && msie != 9;
36776
+ var supportInputEvent = 'oninput' in document.createElement('div') && !(msie && msie <= 11);
36694
36777
 
36695
36778
  chain.enter = function(value, event) {
36696
36779
  return this.addFutureAction("input '" + this.name + "' enter '" + value + "'",