angularjs-rails 1.2.1 → 1.2.2

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.1
2
+ * @license AngularJS v1.2.2
3
3
  * (c) 2010-2012 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -9790,7 +9790,7 @@ if ( typeof module === "object" && module && typeof module.exports === "object"
9790
9790
  })( window );
9791
9791
 
9792
9792
  /**
9793
- * @license AngularJS v1.2.1
9793
+ * @license AngularJS v1.2.2
9794
9794
  * (c) 2010-2012 Google, Inc. http://angularjs.org
9795
9795
  * License: MIT
9796
9796
  */
@@ -9860,7 +9860,7 @@ function minErr(module) {
9860
9860
  return match;
9861
9861
  });
9862
9862
 
9863
- message = message + '\nhttp://errors.angularjs.org/1.2.1/' +
9863
+ message = message + '\nhttp://errors.angularjs.org/1.2.2/' +
9864
9864
  (module ? module + '/' : '') + code;
9865
9865
  for (i = 2; i < arguments.length; i++) {
9866
9866
  message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
@@ -9951,7 +9951,7 @@ function minErr(module) {
9951
9951
  -assertArgFn,
9952
9952
  -assertNotHasOwnProperty,
9953
9953
  -getter,
9954
- -getBlockElements
9954
+ -getBlockElements,
9955
9955
 
9956
9956
  */
9957
9957
 
@@ -10973,26 +10973,38 @@ function encodeUriQuery(val, pctEncodeSpaces) {
10973
10973
  *
10974
10974
  * @description
10975
10975
  *
10976
- * Use this directive to auto-bootstrap an application. Only
10977
- * one ngApp directive can be used per HTML document. The directive
10978
- * designates the root of the application and is typically placed
10979
- * at the root of the page.
10976
+ * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive
10977
+ * designates the **root element** of the application and is typically placed near the root element
10978
+ * of the page - e.g. on the `<body>` or `<html>` tags.
10980
10979
  *
10981
- * The first ngApp found in the document will be auto-bootstrapped. To use multiple applications in
10982
- * an HTML document you must manually bootstrap them using {@link angular.bootstrap}.
10983
- * Applications cannot be nested.
10980
+ * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`
10981
+ * found in the document will be used to define the root element to auto-bootstrap as an
10982
+ * application. To run multiple applications in an HTML document you must manually bootstrap them using
10983
+ * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.
10984
10984
  *
10985
- * In the example below if the `ngApp` directive were not placed
10986
- * on the `html` element then the document would not be compiled
10987
- * and the `{{ 1+2 }}` would not be resolved to `3`.
10985
+ * You can specify an **AngularJS module** to be used as the root module for the application. This
10986
+ * module will be loaded into the {@link AUTO.$injector} when the application is bootstrapped and
10987
+ * should contain the application code needed or have dependencies on other modules that will
10988
+ * contain the code. See {@link angular.module} for more information.
10988
10989
  *
10989
- * `ngApp` is the easiest way to bootstrap an application.
10990
+ * In the example below if the `ngApp` directive were not placed on the `html` element then the
10991
+ * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
10992
+ * would not be resolved to `3`.
10990
10993
  *
10991
- <doc:example>
10992
- <doc:source>
10993
- I can add: 1 + 2 = {{ 1+2 }}
10994
- </doc:source>
10995
- </doc:example>
10994
+ * `ngApp` is the easiest, and most common, way to bootstrap an application.
10995
+ *
10996
+ <example module="ngAppDemo">
10997
+ <file name="index.html">
10998
+ <div ng-controller="ngAppDemoController">
10999
+ I can add: {{a}} + {{b}} = {{ a+b }}
11000
+ </file>
11001
+ <file name="script.js">
11002
+ angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {
11003
+ $scope.a = 1;
11004
+ $scope.b = 2;
11005
+ });
11006
+ </file>
11007
+ </example>
10996
11008
  *
10997
11009
  */
10998
11010
  function angularInit(element, bootstrap) {
@@ -11227,7 +11239,12 @@ function setupModuleLoader(window) {
11227
11239
  return obj[name] || (obj[name] = factory());
11228
11240
  }
11229
11241
 
11230
- return ensure(ensure(window, 'angular', Object), 'module', function() {
11242
+ var angular = ensure(window, 'angular', Object);
11243
+
11244
+ // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap
11245
+ angular.$$minErr = angular.$$minErr || minErr;
11246
+
11247
+ return ensure(angular, 'module', function() {
11231
11248
  /** @type {Object.<string, angular.Module>} */
11232
11249
  var modules = {};
11233
11250
 
@@ -11600,11 +11617,11 @@ function setupModuleLoader(window) {
11600
11617
  * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
11601
11618
  */
11602
11619
  var version = {
11603
- full: '1.2.1', // all of these placeholder strings will be replaced by grunt's
11620
+ full: '1.2.2', // all of these placeholder strings will be replaced by grunt's
11604
11621
  major: 1, // package task
11605
11622
  minor: 2,
11606
- dot: 1,
11607
- codeName: 'underscore-empathy'
11623
+ dot: 2,
11624
+ codeName: 'consciousness-inertia'
11608
11625
  };
11609
11626
 
11610
11627
 
@@ -13151,11 +13168,11 @@ function annotate(fn) {
13151
13168
  * @example
13152
13169
  * Here are some examples of creating value services.
13153
13170
  * <pre>
13154
- * $provide.constant('ADMIN_USER', 'admin');
13171
+ * $provide.value('ADMIN_USER', 'admin');
13155
13172
  *
13156
- * $provide.constant('RoleLookup', { admin: 0, writer: 1, reader: 2 });
13173
+ * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });
13157
13174
  *
13158
- * $provide.constant('halfOf', function(value) {
13175
+ * $provide.value('halfOf', function(value) {
13159
13176
  * return value / 2;
13160
13177
  * });
13161
13178
  * </pre>
@@ -13641,13 +13658,14 @@ var $AnimateProvider = ['$provide', function($provide) {
13641
13658
  * inserted into the DOM
13642
13659
  */
13643
13660
  enter : function(element, parent, after, done) {
13644
- var afterNode = after && after[after.length - 1];
13645
- var parentNode = parent && parent[0] || afterNode && afterNode.parentNode;
13646
- // IE does not like undefined so we have to pass null.
13647
- var afterNextSibling = (afterNode && afterNode.nextSibling) || null;
13648
- forEach(element, function(node) {
13649
- parentNode.insertBefore(node, afterNextSibling);
13650
- });
13661
+ if (after) {
13662
+ after.after(element);
13663
+ } else {
13664
+ if (!parent || !parent[0]) {
13665
+ parent = after.parent();
13666
+ }
13667
+ parent.append(element);
13668
+ }
13651
13669
  done && $timeout(done, 0, false);
13652
13670
  },
13653
13671
 
@@ -15052,6 +15070,24 @@ function $CompileProvider($provide) {
15052
15070
  }
15053
15071
  },
15054
15072
 
15073
+ /**
15074
+ * @ngdoc function
15075
+ * @name ng.$compile.directive.Attributes#$updateClass
15076
+ * @methodOf ng.$compile.directive.Attributes
15077
+ * @function
15078
+ *
15079
+ * @description
15080
+ * Adds and removes the appropriate CSS class values to the element based on the difference
15081
+ * between the new and old CSS class values (specified as newClasses and oldClasses).
15082
+ *
15083
+ * @param {string} newClasses The current CSS className value
15084
+ * @param {string} oldClasses The former CSS className value
15085
+ */
15086
+ $updateClass : function(newClasses, oldClasses) {
15087
+ this.$removeClass(tokenDifference(oldClasses, newClasses));
15088
+ this.$addClass(tokenDifference(newClasses, oldClasses));
15089
+ },
15090
+
15055
15091
  /**
15056
15092
  * Set a normalized attribute on the element in a way such that all directives
15057
15093
  * can share the attribute. This function properly handles boolean attributes.
@@ -15062,59 +15098,53 @@ function $CompileProvider($provide) {
15062
15098
  * @param {string=} attrName Optional none normalized name. Defaults to key.
15063
15099
  */
15064
15100
  $set: function(key, value, writeAttr, attrName) {
15065
- //special case for class attribute addition + removal
15066
- //so that class changes can tap into the animation
15067
- //hooks provided by the $animate service
15068
- if(key == 'class') {
15069
- value = value || '';
15070
- var current = this.$$element.attr('class') || '';
15071
- this.$removeClass(tokenDifference(current, value).join(' '));
15072
- this.$addClass(tokenDifference(value, current).join(' '));
15073
- } else {
15074
- var booleanKey = getBooleanAttrName(this.$$element[0], key),
15075
- normalizedVal,
15076
- nodeName;
15101
+ // TODO: decide whether or not to throw an error if "class"
15102
+ //is set through this function since it may cause $updateClass to
15103
+ //become unstable.
15077
15104
 
15078
- if (booleanKey) {
15079
- this.$$element.prop(key, value);
15080
- attrName = booleanKey;
15081
- }
15105
+ var booleanKey = getBooleanAttrName(this.$$element[0], key),
15106
+ normalizedVal,
15107
+ nodeName;
15082
15108
 
15083
- this[key] = value;
15109
+ if (booleanKey) {
15110
+ this.$$element.prop(key, value);
15111
+ attrName = booleanKey;
15112
+ }
15084
15113
 
15085
- // translate normalized key to actual key
15086
- if (attrName) {
15087
- this.$attr[key] = attrName;
15088
- } else {
15089
- attrName = this.$attr[key];
15090
- if (!attrName) {
15091
- this.$attr[key] = attrName = snake_case(key, '-');
15092
- }
15114
+ this[key] = value;
15115
+
15116
+ // translate normalized key to actual key
15117
+ if (attrName) {
15118
+ this.$attr[key] = attrName;
15119
+ } else {
15120
+ attrName = this.$attr[key];
15121
+ if (!attrName) {
15122
+ this.$attr[key] = attrName = snake_case(key, '-');
15093
15123
  }
15124
+ }
15094
15125
 
15095
- nodeName = nodeName_(this.$$element);
15096
-
15097
- // sanitize a[href] and img[src] values
15098
- if ((nodeName === 'A' && key === 'href') ||
15099
- (nodeName === 'IMG' && key === 'src')) {
15100
- // NOTE: urlResolve() doesn't support IE < 8 so we don't sanitize for that case.
15101
- if (!msie || msie >= 8 ) {
15102
- normalizedVal = urlResolve(value).href;
15103
- if (normalizedVal !== '') {
15104
- if ((key === 'href' && !normalizedVal.match(aHrefSanitizationWhitelist)) ||
15105
- (key === 'src' && !normalizedVal.match(imgSrcSanitizationWhitelist))) {
15106
- this[key] = value = 'unsafe:' + normalizedVal;
15107
- }
15126
+ nodeName = nodeName_(this.$$element);
15127
+
15128
+ // sanitize a[href] and img[src] values
15129
+ if ((nodeName === 'A' && key === 'href') ||
15130
+ (nodeName === 'IMG' && key === 'src')) {
15131
+ // NOTE: urlResolve() doesn't support IE < 8 so we don't sanitize for that case.
15132
+ if (!msie || msie >= 8 ) {
15133
+ normalizedVal = urlResolve(value).href;
15134
+ if (normalizedVal !== '') {
15135
+ if ((key === 'href' && !normalizedVal.match(aHrefSanitizationWhitelist)) ||
15136
+ (key === 'src' && !normalizedVal.match(imgSrcSanitizationWhitelist))) {
15137
+ this[key] = value = 'unsafe:' + normalizedVal;
15108
15138
  }
15109
15139
  }
15110
15140
  }
15141
+ }
15111
15142
 
15112
- if (writeAttr !== false) {
15113
- if (value === null || value === undefined) {
15114
- this.$$element.removeAttr(attrName);
15115
- } else {
15116
- this.$$element.attr(attrName, value);
15117
- }
15143
+ if (writeAttr !== false) {
15144
+ if (value === null || value === undefined) {
15145
+ this.$$element.removeAttr(attrName);
15146
+ } else {
15147
+ this.$$element.attr(attrName, value);
15118
15148
  }
15119
15149
  }
15120
15150
 
@@ -15127,22 +15157,6 @@ function $CompileProvider($provide) {
15127
15157
  $exceptionHandler(e);
15128
15158
  }
15129
15159
  });
15130
-
15131
- function tokenDifference(str1, str2) {
15132
- var values = [],
15133
- tokens1 = str1.split(/\s+/),
15134
- tokens2 = str2.split(/\s+/);
15135
-
15136
- outer:
15137
- for(var i=0;i<tokens1.length;i++) {
15138
- var token = tokens1[i];
15139
- for(var j=0;j<tokens2.length;j++) {
15140
- if(token == tokens2[j]) continue outer;
15141
- }
15142
- values.push(token);
15143
- }
15144
- return values;
15145
- }
15146
15160
  },
15147
15161
 
15148
15162
 
@@ -16164,10 +16178,15 @@ function $CompileProvider($provide) {
16164
16178
 
16165
16179
 
16166
16180
  function getTrustedContext(node, attrNormalizedName) {
16181
+ if (attrNormalizedName == "srcdoc") {
16182
+ return $sce.HTML;
16183
+ }
16184
+ var tag = nodeName_(node);
16167
16185
  // maction[xlink:href] can source SVG. It's not limited to <maction>.
16168
16186
  if (attrNormalizedName == "xlinkHref" ||
16169
- (nodeName_(node) != "IMG" && (attrNormalizedName == "src" ||
16170
- attrNormalizedName == "ngSrc"))) {
16187
+ (tag == "FORM" && attrNormalizedName == "action") ||
16188
+ (tag != "IMG" && (attrNormalizedName == "src" ||
16189
+ attrNormalizedName == "ngSrc"))) {
16171
16190
  return $sce.RESOURCE_URL;
16172
16191
  }
16173
16192
  }
@@ -16212,9 +16231,19 @@ function $CompileProvider($provide) {
16212
16231
  attr[name] = interpolateFn(scope);
16213
16232
  ($$observers[name] || ($$observers[name] = [])).$$inter = true;
16214
16233
  (attr.$$observers && attr.$$observers[name].$$scope || scope).
16215
- $watch(interpolateFn, function interpolateFnWatchAction(value) {
16216
- attr.$set(name, value);
16217
- });
16234
+ $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {
16235
+ //special case for class attribute addition + removal
16236
+ //so that class changes can tap into the animation
16237
+ //hooks provided by the $animate service. Be sure to
16238
+ //skip animations when the first digest occurs (when
16239
+ //both the new and the old values are the same) since
16240
+ //the CSS classes are the non-interpolated values
16241
+ if(name === 'class' && newValue != oldValue) {
16242
+ attr.$updateClass(newValue, oldValue);
16243
+ } else {
16244
+ attr.$set(name, newValue);
16245
+ }
16246
+ });
16218
16247
  }
16219
16248
  };
16220
16249
  }
@@ -16355,6 +16384,22 @@ function directiveLinkingFn(
16355
16384
  /* function(Function) */ boundTranscludeFn
16356
16385
  ){}
16357
16386
 
16387
+ function tokenDifference(str1, str2) {
16388
+ var values = '',
16389
+ tokens1 = str1.split(/\s+/),
16390
+ tokens2 = str2.split(/\s+/);
16391
+
16392
+ outer:
16393
+ for(var i = 0; i < tokens1.length; i++) {
16394
+ var token = tokens1[i];
16395
+ for(var j = 0; j < tokens2.length; j++) {
16396
+ if(token == tokens2[j]) continue outer;
16397
+ }
16398
+ values += (values.length > 0 ? ' ' : '') + token;
16399
+ }
16400
+ return values;
16401
+ }
16402
+
16358
16403
  /**
16359
16404
  * @ngdoc object
16360
16405
  * @name ng.$controllerProvider
@@ -17571,6 +17616,8 @@ function $HttpBackendProvider() {
17571
17616
  }
17572
17617
 
17573
17618
  function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument, locationProtocol) {
17619
+ var ABORTED = -1;
17620
+
17574
17621
  // TODO(vojta): fix the signature
17575
17622
  return function(method, url, post, callback, headers, timeout, withCredentials, responseType) {
17576
17623
  var status;
@@ -17606,13 +17653,19 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,
17606
17653
  // always async
17607
17654
  xhr.onreadystatechange = function() {
17608
17655
  if (xhr.readyState == 4) {
17609
- var responseHeaders = xhr.getAllResponseHeaders();
17656
+ var responseHeaders = null,
17657
+ response = null;
17658
+
17659
+ if(status !== ABORTED) {
17660
+ responseHeaders = xhr.getAllResponseHeaders();
17661
+ response = xhr.responseType ? xhr.response : xhr.responseText;
17662
+ }
17610
17663
 
17611
17664
  // responseText is the old-school way of retrieving response (supported by IE8 & 9)
17612
17665
  // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
17613
17666
  completeRequest(callback,
17614
17667
  status || xhr.status,
17615
- (xhr.responseType ? xhr.response : xhr.responseText),
17668
+ response,
17616
17669
  responseHeaders);
17617
17670
  }
17618
17671
  };
@@ -17636,7 +17689,7 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,
17636
17689
 
17637
17690
 
17638
17691
  function timeoutRequest() {
17639
- status = -1;
17692
+ status = ABORTED;
17640
17693
  jsonpDone && jsonpDone();
17641
17694
  xhr && xhr.abort();
17642
17695
  }
@@ -17665,6 +17718,7 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,
17665
17718
  // - adds and immediately removes script elements from the document
17666
17719
  var script = rawDocument.createElement('script'),
17667
17720
  doneWrapper = function() {
17721
+ script.onreadystatechange = script.onload = script.onerror = null;
17668
17722
  rawDocument.body.removeChild(script);
17669
17723
  if (done) done();
17670
17724
  };
@@ -17672,12 +17726,16 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,
17672
17726
  script.type = 'text/javascript';
17673
17727
  script.src = url;
17674
17728
 
17675
- if (msie) {
17729
+ if (msie && msie <= 8) {
17676
17730
  script.onreadystatechange = function() {
17677
- if (/loaded|complete/.test(script.readyState)) doneWrapper();
17731
+ if (/loaded|complete/.test(script.readyState)) {
17732
+ doneWrapper();
17733
+ }
17678
17734
  };
17679
17735
  } else {
17680
- script.onload = script.onerror = doneWrapper;
17736
+ script.onload = script.onerror = function() {
17737
+ doneWrapper();
17738
+ };
17681
17739
  }
17682
17740
 
17683
17741
  rawDocument.body.appendChild(script);
@@ -18754,7 +18812,7 @@ function $LocationProvider(){
18754
18812
  *
18755
18813
  * The main purpose of this service is to simplify debugging and troubleshooting.
18756
18814
  *
18757
- * The default is not to log `debug` messages. You can use
18815
+ * The default is to log `debug` messages. You can use
18758
18816
  * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.
18759
18817
  *
18760
18818
  * @example
@@ -19920,7 +19978,7 @@ function getterFn(path, options, fullExp) {
19920
19978
  : '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '["' + key + '"]' + ';\n' +
19921
19979
  (options.unwrapPromises
19922
19980
  ? 'if (s && s.then) {\n' +
19923
- ' pw("' + fullExp.replace(/\"/g, '\\"') + '");\n' +
19981
+ ' pw("' + fullExp.replace(/(["\r\n])/g, '\\$1') + '");\n' +
19924
19982
  ' if (!("$$v" in s)) {\n' +
19925
19983
  ' p=s;\n' +
19926
19984
  ' p.$$v = undefined;\n' +
@@ -21890,8 +21948,7 @@ function $SceDelegateProvider() {
21890
21948
  return resourceUrlBlacklist;
21891
21949
  };
21892
21950
 
21893
- this.$get = ['$log', '$document', '$injector', function(
21894
- $log, $document, $injector) {
21951
+ this.$get = ['$injector', function($injector) {
21895
21952
 
21896
21953
  var htmlSanitizer = function htmlSanitizer(html) {
21897
21954
  throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
@@ -22422,18 +22479,15 @@ function $SceProvider() {
22422
22479
  * sce.js and sceSpecs.js would need to be aware of this detail.
22423
22480
  */
22424
22481
 
22425
- this.$get = ['$parse', '$document', '$sceDelegate', function(
22426
- $parse, $document, $sceDelegate) {
22482
+ this.$get = ['$parse', '$sniffer', '$sceDelegate', function(
22483
+ $parse, $sniffer, $sceDelegate) {
22427
22484
  // Prereq: Ensure that we're not running in IE8 quirks mode. In that mode, IE allows
22428
22485
  // the "expression(javascript expression)" syntax which is insecure.
22429
- if (enabled && msie) {
22430
- var documentMode = $document[0].documentMode;
22431
- if (documentMode !== undefined && documentMode < 8) {
22432
- throw $sceMinErr('iequirks',
22433
- 'Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks ' +
22434
- 'mode. You can fix this by adding the text <!doctype html> to the top of your HTML ' +
22435
- 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');
22436
- }
22486
+ if (enabled && $sniffer.msie && $sniffer.msieDocumentMode < 8) {
22487
+ throw $sceMinErr('iequirks',
22488
+ 'Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks ' +
22489
+ 'mode. You can fix this by adding the text <!doctype html> to the top of your HTML ' +
22490
+ 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');
22437
22491
  }
22438
22492
 
22439
22493
  var sce = copy(SCE_CONTEXTS);
@@ -22795,6 +22849,7 @@ function $SnifferProvider() {
22795
22849
  int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),
22796
22850
  boxee = /Boxee/i.test(($window.navigator || {}).userAgent),
22797
22851
  document = $document[0] || {},
22852
+ documentMode = document.documentMode,
22798
22853
  vendorPrefix,
22799
22854
  vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/,
22800
22855
  bodyStyle = document.body && document.body.style,
@@ -22839,7 +22894,7 @@ function $SnifferProvider() {
22839
22894
  // jshint +W018
22840
22895
  hashchange: 'onhashchange' in $window &&
22841
22896
  // IE8 compatible mode lies
22842
- (!document.documentMode || document.documentMode > 7),
22897
+ (!documentMode || documentMode > 7),
22843
22898
  hasEvent: function(event) {
22844
22899
  // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have
22845
22900
  // it. In particular the event is not fired when backspace or delete key are pressed or
@@ -22857,7 +22912,8 @@ function $SnifferProvider() {
22857
22912
  vendorPrefix: vendorPrefix,
22858
22913
  transitions : transitions,
22859
22914
  animations : animations,
22860
- msie : msie
22915
+ msie : msie,
22916
+ msieDocumentMode: documentMode
22861
22917
  };
22862
22918
  }];
22863
22919
  }
@@ -24472,8 +24528,11 @@ var htmlAnchorDirective = valueFn({
24472
24528
  *
24473
24529
  * The HTML specification does not require browsers to preserve the values of boolean attributes
24474
24530
  * such as disabled. (Their presence means true and their absence means false.)
24475
- * This prevents the Angular compiler from retrieving the binding expression.
24531
+ * If we put an Angular interpolation expression into such an attribute then the
24532
+ * binding information would be lost when the browser removes the attribute.
24476
24533
  * The `ngDisabled` directive solves this problem for the `disabled` attribute.
24534
+ * This complementary directive is not removed by the browser and so provides
24535
+ * a permanent reliable place to store the binding information.
24477
24536
  *
24478
24537
  * @example
24479
24538
  <doc:example>
@@ -24504,8 +24563,11 @@ var htmlAnchorDirective = valueFn({
24504
24563
  * @description
24505
24564
  * The HTML specification does not require browsers to preserve the values of boolean attributes
24506
24565
  * such as checked. (Their presence means true and their absence means false.)
24507
- * This prevents the Angular compiler from retrieving the binding expression.
24566
+ * If we put an Angular interpolation expression into such an attribute then the
24567
+ * binding information would be lost when the browser removes the attribute.
24508
24568
  * The `ngChecked` directive solves this problem for the `checked` attribute.
24569
+ * This complementary directive is not removed by the browser and so provides
24570
+ * a permanent reliable place to store the binding information.
24509
24571
  * @example
24510
24572
  <doc:example>
24511
24573
  <doc:source>
@@ -24535,8 +24597,12 @@ var htmlAnchorDirective = valueFn({
24535
24597
  * @description
24536
24598
  * The HTML specification does not require browsers to preserve the values of boolean attributes
24537
24599
  * such as readonly. (Their presence means true and their absence means false.)
24538
- * This prevents the Angular compiler from retrieving the binding expression.
24600
+ * If we put an Angular interpolation expression into such an attribute then the
24601
+ * binding information would be lost when the browser removes the attribute.
24539
24602
  * The `ngReadonly` directive solves this problem for the `readonly` attribute.
24603
+ * This complementary directive is not removed by the browser and so provides
24604
+ * a permanent reliable place to store the binding information.
24605
+
24540
24606
  * @example
24541
24607
  <doc:example>
24542
24608
  <doc:source>
@@ -24566,8 +24632,11 @@ var htmlAnchorDirective = valueFn({
24566
24632
  * @description
24567
24633
  * The HTML specification does not require browsers to preserve the values of boolean attributes
24568
24634
  * such as selected. (Their presence means true and their absence means false.)
24569
- * This prevents the Angular compiler from retrieving the binding expression.
24635
+ * If we put an Angular interpolation expression into such an attribute then the
24636
+ * binding information would be lost when the browser removes the attribute.
24570
24637
  * The `ngSelected` directive solves this problem for the `selected` atttribute.
24638
+ * This complementary directive is not removed by the browser and so provides
24639
+ * a permanent reliable place to store the binding information.
24571
24640
  * @example
24572
24641
  <doc:example>
24573
24642
  <doc:source>
@@ -24599,8 +24668,12 @@ var htmlAnchorDirective = valueFn({
24599
24668
  * @description
24600
24669
  * The HTML specification does not require browsers to preserve the values of boolean attributes
24601
24670
  * such as open. (Their presence means true and their absence means false.)
24602
- * This prevents the Angular compiler from retrieving the binding expression.
24671
+ * If we put an Angular interpolation expression into such an attribute then the
24672
+ * binding information would be lost when the browser removes the attribute.
24603
24673
  * The `ngOpen` directive solves this problem for the `open` attribute.
24674
+ * This complementary directive is not removed by the browser and so provides
24675
+ * a permanent reliable place to store the binding information.
24676
+
24604
24677
  *
24605
24678
  * @example
24606
24679
  <doc:example>
@@ -25430,8 +25503,21 @@ var inputType = {
25430
25503
 
25431
25504
 
25432
25505
  function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
25506
+ // In composition mode, users are still inputing intermediate text buffer,
25507
+ // hold the listener until composition is done.
25508
+ // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent
25509
+ var composing = false;
25510
+
25511
+ element.on('compositionstart', function() {
25512
+ composing = true;
25513
+ });
25514
+
25515
+ element.on('compositionend', function() {
25516
+ composing = false;
25517
+ });
25433
25518
 
25434
25519
  var listener = function() {
25520
+ if (composing) return;
25435
25521
  var value = element.val();
25436
25522
 
25437
25523
  // By default we will trim the value
@@ -26721,11 +26807,10 @@ function classDirective(name, selector) {
26721
26807
  // jshint bitwise: false
26722
26808
  var mod = $index & 1;
26723
26809
  if (mod !== old$index & 1) {
26724
- if (mod === selector) {
26725
- addClass(scope.$eval(attr[name]));
26726
- } else {
26727
- removeClass(scope.$eval(attr[name]));
26728
- }
26810
+ var classes = flattenClasses(scope.$eval(attr[name]));
26811
+ mod === selector ?
26812
+ attr.$addClass(classes) :
26813
+ attr.$removeClass(classes);
26729
26814
  }
26730
26815
  });
26731
26816
  }
@@ -26733,24 +26818,17 @@ function classDirective(name, selector) {
26733
26818
 
26734
26819
  function ngClassWatchAction(newVal) {
26735
26820
  if (selector === true || scope.$index % 2 === selector) {
26736
- if (oldVal && !equals(newVal,oldVal)) {
26737
- removeClass(oldVal);
26821
+ var newClasses = flattenClasses(newVal || '');
26822
+ if(!oldVal) {
26823
+ attr.$addClass(newClasses);
26824
+ } else if(!equals(newVal,oldVal)) {
26825
+ attr.$updateClass(newClasses, flattenClasses(oldVal));
26738
26826
  }
26739
- addClass(newVal);
26740
26827
  }
26741
26828
  oldVal = copy(newVal);
26742
26829
  }
26743
26830
 
26744
26831
 
26745
- function removeClass(classVal) {
26746
- attr.$removeClass(flattenClasses(classVal));
26747
- }
26748
-
26749
-
26750
- function addClass(classVal) {
26751
- attr.$addClass(flattenClasses(classVal));
26752
- }
26753
-
26754
26832
  function flattenClasses(classVal) {
26755
26833
  if(isArray(classVal)) {
26756
26834
  return classVal.join(' ');
@@ -27228,7 +27306,8 @@ var ngCloakDirective = ngDirective({
27228
27306
  var ngControllerDirective = [function() {
27229
27307
  return {
27230
27308
  scope: true,
27231
- controller: '@'
27309
+ controller: '@',
27310
+ priority: 500
27232
27311
  };
27233
27312
  }];
27234
27313
 
@@ -27924,18 +28003,23 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
27924
28003
  if (thisChangeId !== changeCounter) return;
27925
28004
  var newScope = scope.$new();
27926
28005
 
27927
- $transclude(newScope, function(clone) {
27928
- cleanupLastIncludeContent();
27929
-
27930
- currentScope = newScope;
27931
- currentElement = clone;
27932
-
27933
- currentElement.html(response);
27934
- $animate.enter(currentElement, null, $element, afterAnimation);
27935
- $compile(currentElement.contents())(currentScope);
27936
- currentScope.$emit('$includeContentLoaded');
27937
- scope.$eval(onloadExp);
27938
- });
28006
+ // Note: This will also link all children of ng-include that were contained in the original
28007
+ // html. If that content contains controllers, ... they could pollute/change the scope.
28008
+ // However, using ng-include on an element with additional content does not make sense...
28009
+ // Note: We can't remove them in the cloneAttchFn of $transclude as that
28010
+ // function is called before linking the content, which would apply child
28011
+ // directives to non existing elements.
28012
+ var clone = $transclude(newScope, noop);
28013
+ cleanupLastIncludeContent();
28014
+
28015
+ currentScope = newScope;
28016
+ currentElement = clone;
28017
+
28018
+ currentElement.html(response);
28019
+ $animate.enter(currentElement, null, $element, afterAnimation);
28020
+ $compile(currentElement.contents())(currentScope);
28021
+ currentScope.$emit('$includeContentLoaded');
28022
+ scope.$eval(onloadExp);
27939
28023
  }).error(function() {
27940
28024
  if (thisChangeId === changeCounter) cleanupLastIncludeContent();
27941
28025
  });
@@ -28090,7 +28174,7 @@ var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });
28090
28174
  * other numbers, for example 12, so that instead of showing "12 people are viewing", you can
28091
28175
  * show "a dozen people are viewing".
28092
28176
  *
28093
- * You can use a set of closed braces(`{}`) as a placeholder for the number that you want substituted
28177
+ * You can use a set of closed braces (`{}`) as a placeholder for the number that you want substituted
28094
28178
  * into pluralized strings. In the previous example, Angular will replace `{}` with
28095
28179
  * <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder
28096
28180
  * for <span ng-non-bindable>{{numberExpression}}</span>.
@@ -28351,7 +28435,7 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp
28351
28435
  * For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique
28352
28436
  * `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements
28353
28437
  * with the corresponding item in the array by identity. Moving the same object in array would move the DOM
28354
- * element in the same way ian the DOM.
28438
+ * element in the same way in the DOM.
28355
28439
  *
28356
28440
  * For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this
28357
28441
  * case the object identity does not matter. Two objects are considered equivalent as long as their `id`
@@ -32132,5 +32216,5 @@ if (config.autotest) {
32132
32216
  })(window, document);
32133
32217
 
32134
32218
 
32135
- !angular.$$csp() && angular.element(document).find('head').prepend('<style type="text/css">@charset "UTF-8";\n\n[ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],\n.ng-cloak, .x-ng-cloak,\n.ng-hide {\n display: none !important;\n}\n\nng\\:form {\n display: block;\n}\n\n/* The styles below ensure that the CSS transition will ALWAYS\n * animate and close. A nasty bug occurs with CSS transitions where\n * when the active class isn\'t set, or if the active class doesn\'t\n * contain any styles to transition to, then, if ngAnimate is used,\n * it will appear as if the webpage is broken due to the forever hanging\n * animations. The clip (!ie) and zoom (ie) CSS properties are used\n * since they trigger a transition without making the browser\n * animate anything and they\'re both highly underused CSS properties */\n.ng-animate-start { clip:rect(0, auto, auto, 0); -ms-zoom:1.0001; }\n.ng-animate-active { clip:rect(-1px, auto, auto, 0); -ms-zoom:1; }\n</style>');
32219
+ !angular.$$csp() && angular.element(document).find('head').prepend('<style type="text/css">@charset "UTF-8";\n\n[ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],\n.ng-cloak, .x-ng-cloak,\n.ng-hide {\n display: none !important;\n}\n\nng\\:form {\n display: block;\n}\n\n/* The styles below ensure that the CSS transition will ALWAYS\n * animate and close. A nasty bug occurs with CSS transitions where\n * when the active class isn\'t set, or if the active class doesn\'t\n * contain any styles to transition to, then, if ngAnimate is used,\n * it will appear as if the webpage is broken due to the forever hanging\n * animations. The border-spacing (!ie) and zoom (ie) CSS properties are\n * used below since they trigger a transition without making the browser\n * animate anything and they\'re both highly underused CSS properties */\n.ng-animate-start { border-spacing:1px 1px; -ms-zoom:1.0001; }\n.ng-animate-active { border-spacing:0px 0px; -ms-zoom:1; }\n</style>');
32136
32220
  !angular.$$csp() && angular.element(document).find('head').prepend('<style type="text/css">@charset "UTF-8";\n/* CSS Document */\n\n/** Structure */\nbody {\n font-family: Arial, sans-serif;\n margin: 0;\n font-size: 14px;\n}\n\n#system-error {\n font-size: 1.5em;\n text-align: center;\n}\n\n#json, #xml {\n display: none;\n}\n\n#header {\n position: fixed;\n width: 100%;\n}\n\n#specs {\n padding-top: 50px;\n}\n\n#header .angular {\n font-family: Courier New, monospace;\n font-weight: bold;\n}\n\n#header h1 {\n font-weight: normal;\n float: left;\n font-size: 30px;\n line-height: 30px;\n margin: 0;\n padding: 10px 10px;\n height: 30px;\n}\n\n#application h2,\n#specs h2 {\n margin: 0;\n padding: 0.5em;\n font-size: 1.1em;\n}\n\n#status-legend {\n margin-top: 10px;\n margin-right: 10px;\n}\n\n#header,\n#application,\n.test-info,\n.test-actions li {\n overflow: hidden;\n}\n\n#application {\n margin: 10px;\n}\n\n#application iframe {\n width: 100%;\n height: 758px;\n}\n\n#application .popout {\n float: right;\n}\n\n#application iframe {\n border: none;\n}\n\n.tests li,\n.test-actions li,\n.test-it li,\n.test-it ol,\n.status-display {\n list-style-type: none;\n}\n\n.tests,\n.test-it ol,\n.status-display {\n margin: 0;\n padding: 0;\n}\n\n.test-info {\n margin-left: 1em;\n margin-top: 0.5em;\n border-radius: 8px 0 0 8px;\n -webkit-border-radius: 8px 0 0 8px;\n -moz-border-radius: 8px 0 0 8px;\n cursor: pointer;\n}\n\n.test-info:hover .test-name {\n text-decoration: underline;\n}\n\n.test-info .closed:before {\n content: \'\\25b8\\00A0\';\n}\n\n.test-info .open:before {\n content: \'\\25be\\00A0\';\n font-weight: bold;\n}\n\n.test-it ol {\n margin-left: 2.5em;\n}\n\n.status-display,\n.status-display li {\n float: right;\n}\n\n.status-display li {\n padding: 5px 10px;\n}\n\n.timer-result,\n.test-title {\n display: inline-block;\n margin: 0;\n padding: 4px;\n}\n\n.test-actions .test-title,\n.test-actions .test-result {\n display: table-cell;\n padding-left: 0.5em;\n padding-right: 0.5em;\n}\n\n.test-actions {\n display: table;\n}\n\n.test-actions li {\n display: table-row;\n}\n\n.timer-result {\n width: 4em;\n padding: 0 10px;\n text-align: right;\n font-family: monospace;\n}\n\n.test-it pre,\n.test-actions pre {\n clear: left;\n color: black;\n margin-left: 6em;\n}\n\n.test-describe {\n padding-bottom: 0.5em;\n}\n\n.test-describe .test-describe {\n margin: 5px 5px 10px 2em;\n}\n\n.test-actions .status-pending .test-title:before {\n content: \'\\00bb\\00A0\';\n}\n\n.scrollpane {\n max-height: 20em;\n overflow: auto;\n}\n\n/** Colors */\n\n#header {\n background-color: #F2C200;\n}\n\n#specs h2 {\n border-top: 2px solid #BABAD1;\n}\n\n#specs h2,\n#application h2 {\n background-color: #efefef;\n}\n\n#application {\n border: 1px solid #BABAD1;\n}\n\n.test-describe .test-describe {\n border-left: 1px solid #BABAD1;\n border-right: 1px solid #BABAD1;\n border-bottom: 1px solid #BABAD1;\n}\n\n.status-display {\n border: 1px solid #777;\n}\n\n.status-display .status-pending,\n.status-pending .test-info {\n background-color: #F9EEBC;\n}\n\n.status-display .status-success,\n.status-success .test-info {\n background-color: #B1D7A1;\n}\n\n.status-display .status-failure,\n.status-failure .test-info {\n background-color: #FF8286;\n}\n\n.status-display .status-error,\n.status-error .test-info {\n background-color: black;\n color: white;\n}\n\n.test-actions .status-success .test-title {\n color: #30B30A;\n}\n\n.test-actions .status-failure .test-title {\n color: #DF0000;\n}\n\n.test-actions .status-error .test-title {\n color: black;\n}\n\n.test-actions .timer-result {\n color: #888;\n}\n</style>');