angularjs-rails 1.2.7 → 1.2.9

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.7
2
+ * @license AngularJS v1.2.9
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -95,7 +95,7 @@ function shallowClearAndCopy(src, dst) {
95
95
  * when a param value needs to be obtained for a request (unless the param was overridden).
96
96
  *
97
97
  * Each key value in the parameter object is first bound to url template if present and then any
98
- * excess keys are appended to the url seapph query after the `?`.
98
+ * excess keys are appended to the url search query after the `?`.
99
99
  *
100
100
  * Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in
101
101
  * URL `/path/greet?salutation=Hello`.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.7
2
+ * @license AngularJS v1.2.9
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -669,6 +669,15 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
669
669
  *
670
670
  * @scope
671
671
  * @priority 400
672
+ * @param {string=} onload Expression to evaluate whenever the view updates.
673
+ *
674
+ * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll
675
+ * $anchorScroll} to scroll the viewport after the view is updated.
676
+ *
677
+ * - If the attribute is not set, disable scrolling.
678
+ * - If the attribute is set without value, enable scrolling.
679
+ * - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated
680
+ * as an expression yields a truthy value.
672
681
  * @example
673
682
  <example module="ngViewExample" deps="angular-route.js" animations="true">
674
683
  <file name="index.html">
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.7
2
+ * @license AngularJS v1.2.9
3
3
  * (c) 2010-2014 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.7
9793
+ * @license AngularJS v1.2.9
9794
9794
  * (c) 2010-2014 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.7/' +
9863
+ message = message + '\nhttp://errors.angularjs.org/1.2.9/' +
9864
9864
  (module ? module + '/' : '') + code;
9865
9865
  for (i = 2; i < arguments.length; i++) {
9866
9866
  message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
@@ -10063,7 +10063,8 @@ function isArrayLike(obj) {
10063
10063
  * is the value of an object property or an array element and `key` is the object property key or
10064
10064
  * array element index. Specifying a `context` for the function is optional.
10065
10065
  *
10066
- * Note: this function was previously known as `angular.foreach`.
10066
+ * It is worth nothing that `.forEach` does not iterate over inherited properties because it filters
10067
+ * using the `hasOwnProperty` method.
10067
10068
  *
10068
10069
  <pre>
10069
10070
  var values = {name: 'misko', gender: 'male'};
@@ -11625,11 +11626,11 @@ function setupModuleLoader(window) {
11625
11626
  * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
11626
11627
  */
11627
11628
  var version = {
11628
- full: '1.2.7', // all of these placeholder strings will be replaced by grunt's
11629
+ full: '1.2.9', // all of these placeholder strings will be replaced by grunt's
11629
11630
  major: 1, // package task
11630
11631
  minor: 2,
11631
- dot: 7,
11632
- codeName: 'emoji-clairvoyance'
11632
+ dot: 9,
11633
+ codeName: 'enchanted-articulacy'
11633
11634
  };
11634
11635
 
11635
11636
 
@@ -13191,7 +13192,7 @@ function annotate(fn) {
13191
13192
  * constructor function that will be used to instantiate the service instance.
13192
13193
  *
13193
13194
  * You should use {@link AUTO.$provide#methods_service $provide.service(class)} if you define your service
13194
- * as a type/class. This is common when using {@link http://coffeescript.org CoffeeScript}.
13195
+ * as a type/class.
13195
13196
  *
13196
13197
  * @param {string} name The name of the instance.
13197
13198
  * @param {Function} constructor A class (constructor function) that will be instantiated.
@@ -13199,20 +13200,25 @@ function annotate(fn) {
13199
13200
  *
13200
13201
  * @example
13201
13202
  * Here is an example of registering a service using
13202
- * {@link AUTO.$provide#methods_service $provide.service(class)} that is defined as a CoffeeScript class.
13203
+ * {@link AUTO.$provide#methods_service $provide.service(class)}.
13203
13204
  * <pre>
13204
- * class Ping
13205
- * constructor: (@$http) ->
13206
- * send: () =>
13207
- * @$http.get('/ping')
13208
- *
13209
- * $provide.service('ping', ['$http', Ping])
13205
+ * $provide.service('ping', ['$http', function($http) {
13206
+ * var Ping = function() {
13207
+ * this.$http = $http;
13208
+ * };
13209
+ *
13210
+ * Ping.prototype.send = function() {
13211
+ * return this.$http.get('/ping');
13212
+ * };
13213
+ *
13214
+ * return Ping;
13215
+ * }]);
13210
13216
  * </pre>
13211
13217
  * You would then inject and use this service like this:
13212
13218
  * <pre>
13213
- * someModule.controller 'Ctrl', ['ping', (ping) ->
13214
- * ping.send()
13215
- * ]
13219
+ * someModule.controller('Ctrl', ['ping', function(ping) {
13220
+ * ping.send();
13221
+ * }]);
13216
13222
  * </pre>
13217
13223
  */
13218
13224
 
@@ -16440,7 +16446,7 @@ function directiveNormalize(name) {
16440
16446
  *
16441
16447
  *
16442
16448
  * @param {string} name Normalized element attribute name of the property to modify. The name is
16443
- * revers translated using the {@link ng.$compile.directive.Attributes#$attr $attr}
16449
+ * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}
16444
16450
  * property to the original name.
16445
16451
  * @param {string} value Value to set the attribute to. The value can be an interpolated string.
16446
16452
  */
@@ -16578,8 +16584,7 @@ function $ControllerProvider() {
16578
16584
  * @requires $window
16579
16585
  *
16580
16586
  * @description
16581
- * A {@link angular.element jQuery (lite)}-wrapped reference to the browser's `window.document`
16582
- * element.
16587
+ * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.
16583
16588
  */
16584
16589
  function $DocumentProvider(){
16585
16590
  this.$get = ['$window', function(window){
@@ -16738,9 +16743,9 @@ function $HttpProvider() {
16738
16743
  common: {
16739
16744
  'Accept': 'application/json, text/plain, */*'
16740
16745
  },
16741
- post: CONTENT_TYPE_APPLICATION_JSON,
16742
- put: CONTENT_TYPE_APPLICATION_JSON,
16743
- patch: CONTENT_TYPE_APPLICATION_JSON
16746
+ post: copy(CONTENT_TYPE_APPLICATION_JSON),
16747
+ put: copy(CONTENT_TYPE_APPLICATION_JSON),
16748
+ patch: copy(CONTENT_TYPE_APPLICATION_JSON)
16744
16749
  },
16745
16750
 
16746
16751
  xsrfCookieName: 'XSRF-TOKEN',
@@ -16918,7 +16923,15 @@ function $HttpProvider() {
16918
16923
  * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }.
16919
16924
  *
16920
16925
  * The defaults can also be set at runtime via the `$http.defaults` object in the same
16921
- * fashion. In addition, you can supply a `headers` property in the config object passed when
16926
+ * fashion. For example:
16927
+ *
16928
+ * ```
16929
+ * module.run(function($http) {
16930
+ * $http.defaults.headers.common.Authentication = 'Basic YmVlcDpib29w'
16931
+ * });
16932
+ * ```
16933
+ *
16934
+ * In addition, you can supply a `headers` property in the config object passed when
16922
16935
  * calling `$http(config)`, which overrides the defaults without changing them globally.
16923
16936
  *
16924
16937
  *
@@ -16942,7 +16955,9 @@ function $HttpProvider() {
16942
16955
  * properties. These properties are by default an array of transform functions, which allows you
16943
16956
  * to `push` or `unshift` a new transformation function into the transformation chain. You can
16944
16957
  * also decide to completely override any default transformations by assigning your
16945
- * transformation functions to these properties directly without the array wrapper.
16958
+ * transformation functions to these properties directly without the array wrapper. These defaults
16959
+ * are again available on the $http factory at run-time, which may be useful if you have run-time
16960
+ * services you wish to be involved in your transformations.
16946
16961
  *
16947
16962
  * Similarly, to locally override the request/response transforms, augment the
16948
16963
  * `transformRequest` and/or `transformResponse` properties of the configuration object passed
@@ -17156,7 +17171,8 @@ function $HttpProvider() {
17156
17171
  * for added security.
17157
17172
  *
17158
17173
  * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
17159
- * properties of either $httpProvider.defaults, or the per-request config object.
17174
+ * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,
17175
+ * or the per-request config object.
17160
17176
  *
17161
17177
  *
17162
17178
  * @param {object} config Object describing the request to be made and how it should be
@@ -17719,7 +17735,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
17719
17735
  } else {
17720
17736
  completeRequest(callback, status || -2);
17721
17737
  }
17722
- delete callbacks[callbackId];
17738
+ callbacks[callbackId] = angular.noop;
17723
17739
  });
17724
17740
  } else {
17725
17741
 
@@ -17736,7 +17752,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
17736
17752
  // response is in the cache. the promise api will ensure that to the app code the api is
17737
17753
  // always async
17738
17754
  xhr.onreadystatechange = function() {
17739
- // onreadystatechange might by called multiple times with readyState === 4 on mobile webkit caused by
17755
+ // onreadystatechange might get called multiple times with readyState === 4 on mobile webkit caused by
17740
17756
  // xhrs that are resolved while the app is in the background (see #5426).
17741
17757
  // since calling completeRequest sets the `xhr` variable to null, we just check if it's not null before
17742
17758
  // continuing
@@ -17749,11 +17765,12 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
17749
17765
 
17750
17766
  if(status !== ABORTED) {
17751
17767
  responseHeaders = xhr.getAllResponseHeaders();
17752
- response = xhr.responseType ? xhr.response : xhr.responseText;
17768
+
17769
+ // responseText is the old-school way of retrieving response (supported by IE8 & 9)
17770
+ // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
17771
+ response = ('response' in xhr) ? xhr.response : xhr.responseText;
17753
17772
  }
17754
17773
 
17755
- // responseText is the old-school way of retrieving response (supported by IE8 & 9)
17756
- // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
17757
17774
  completeRequest(callback,
17758
17775
  status || xhr.status,
17759
17776
  response,
@@ -17786,14 +17803,14 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
17786
17803
  }
17787
17804
 
17788
17805
  function completeRequest(callback, status, response, headersString) {
17789
- var protocol = urlResolve(url).protocol;
17790
-
17791
17806
  // cancel timeout and subsequent timeout promise resolution
17792
17807
  timeoutId && $browserDefer.cancel(timeoutId);
17793
17808
  jsonpDone = xhr = null;
17794
17809
 
17795
- // fix status code for file protocol (it's always 0)
17796
- status = (protocol == 'file' && status === 0) ? (response ? 200 : 404) : status;
17810
+ // fix status code when it is 0 (0 status is undocumented).
17811
+ // Occurs when accessing file resources.
17812
+ // On Android 4.1 stock browser it occurs while retrieving files from application cache.
17813
+ status = (status === 0) ? (response ? 200 : 404) : status;
17797
17814
 
17798
17815
  // normalize IE bug (http://bugs.jquery.com/ticket/1450)
17799
17816
  status = status == 1223 ? 204 : status;
@@ -18907,7 +18924,7 @@ function $LocationProvider(){
18907
18924
  * Broadcasted before a URL will change. This change can be prevented by calling
18908
18925
  * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
18909
18926
  * details about event object. Upon successful change
18910
- * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.
18927
+ * {@link ng.$location#events_$locationChangeSuccess $locationChangeSuccess} is fired.
18911
18928
  *
18912
18929
  * @param {Object} angularEvent Synthetic event object.
18913
18930
  * @param {string} newUrl New URL
@@ -20098,16 +20115,20 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
20098
20115
  if (pathVal == null) return pathVal;
20099
20116
  pathVal = pathVal[key0];
20100
20117
 
20101
- if (pathVal == null) return key1 ? undefined : pathVal;
20118
+ if (!key1) return pathVal;
20119
+ if (pathVal == null) return undefined;
20102
20120
  pathVal = pathVal[key1];
20103
20121
 
20104
- if (pathVal == null) return key2 ? undefined : pathVal;
20122
+ if (!key2) return pathVal;
20123
+ if (pathVal == null) return undefined;
20105
20124
  pathVal = pathVal[key2];
20106
20125
 
20107
- if (pathVal == null) return key3 ? undefined : pathVal;
20126
+ if (!key3) return pathVal;
20127
+ if (pathVal == null) return undefined;
20108
20128
  pathVal = pathVal[key3];
20109
20129
 
20110
- if (pathVal == null) return key4 ? undefined : pathVal;
20130
+ if (!key4) return pathVal;
20131
+ if (pathVal == null) return undefined;
20111
20132
  pathVal = pathVal[key4];
20112
20133
 
20113
20134
  return pathVal;
@@ -20128,8 +20149,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
20128
20149
  }
20129
20150
  pathVal = pathVal.$$v;
20130
20151
  }
20131
- if (pathVal == null) return key1 ? undefined : pathVal;
20132
20152
 
20153
+ if (!key1) return pathVal;
20154
+ if (pathVal == null) return undefined;
20133
20155
  pathVal = pathVal[key1];
20134
20156
  if (pathVal && pathVal.then) {
20135
20157
  promiseWarning(fullExp);
@@ -20140,8 +20162,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
20140
20162
  }
20141
20163
  pathVal = pathVal.$$v;
20142
20164
  }
20143
- if (pathVal == null) return key2 ? undefined : pathVal;
20144
20165
 
20166
+ if (!key2) return pathVal;
20167
+ if (pathVal == null) return undefined;
20145
20168
  pathVal = pathVal[key2];
20146
20169
  if (pathVal && pathVal.then) {
20147
20170
  promiseWarning(fullExp);
@@ -20152,8 +20175,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
20152
20175
  }
20153
20176
  pathVal = pathVal.$$v;
20154
20177
  }
20155
- if (pathVal == null) return key3 ? undefined : pathVal;
20156
20178
 
20179
+ if (!key3) return pathVal;
20180
+ if (pathVal == null) return undefined;
20157
20181
  pathVal = pathVal[key3];
20158
20182
  if (pathVal && pathVal.then) {
20159
20183
  promiseWarning(fullExp);
@@ -20164,8 +20188,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
20164
20188
  }
20165
20189
  pathVal = pathVal.$$v;
20166
20190
  }
20167
- if (pathVal == null) return key4 ? undefined : pathVal;
20168
20191
 
20192
+ if (!key4) return pathVal;
20193
+ if (pathVal == null) return undefined;
20169
20194
  pathVal = pathVal[key4];
20170
20195
  if (pathVal && pathVal.then) {
20171
20196
  promiseWarning(fullExp);
@@ -21163,7 +21188,7 @@ function $RootScopeProvider(){
21163
21188
  } else {
21164
21189
  ChildScope = function() {}; // should be anonymous; This is so that when the minifier munges
21165
21190
  // the name it does not become random set of chars. This will then show up as class
21166
- // name in the debugger.
21191
+ // name in the web inspector.
21167
21192
  ChildScope.prototype = this;
21168
21193
  child = new ChildScope();
21169
21194
  child.$id = nextUid();
@@ -21264,7 +21289,7 @@ function $RootScopeProvider(){
21264
21289
  // No digest has been run so the counter will be zero
21265
21290
  expect(scope.foodCounter).toEqual(0);
21266
21291
 
21267
- // Run the digest but since food has not changed cout will still be zero
21292
+ // Run the digest but since food has not changed count will still be zero
21268
21293
  scope.$digest();
21269
21294
  expect(scope.foodCounter).toEqual(0);
21270
21295
 
@@ -21609,7 +21634,7 @@ function $RootScopeProvider(){
21609
21634
 
21610
21635
  // `break traverseScopesLoop;` takes us to here
21611
21636
 
21612
- if(dirty && !(ttl--)) {
21637
+ if((dirty || asyncQueue.length) && !(ttl--)) {
21613
21638
  clearPhase();
21614
21639
  throw $rootScopeMinErr('infdig',
21615
21640
  '{0} $digest() iterations reached. Aborting!\n' +
@@ -22460,7 +22485,7 @@ function $SceDelegateProvider() {
22460
22485
  *
22461
22486
  * @param {*} value The result of a prior {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`}
22462
22487
  * call or anything else.
22463
- * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#methods_trustAs
22488
+ * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#methods_trustAs
22464
22489
  * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns
22465
22490
  * `value` unchanged.
22466
22491
  */
@@ -23687,8 +23712,8 @@ function $FilterProvider($provide) {
23687
23712
  *
23688
23713
  * Can be one of:
23689
23714
  *
23690
- * - `string`: Predicate that results in a substring match using the value of `expression`
23691
- * string. All strings or objects with string properties in `array` that contain this string
23715
+ * - `string`: The string is evaluated as an expression and the resulting value is used for substring match against
23716
+ * the contents of the `array`. All strings or objects with string properties in `array` that contain this string
23692
23717
  * will be returned. The predicate can be negated by prefixing the string with `!`.
23693
23718
  *
23694
23719
  * - `Object`: A pattern object can be used to filter specific properties on objects contained
@@ -23846,23 +23871,12 @@ function filterFilter() {
23846
23871
  case "object":
23847
23872
  // jshint +W086
23848
23873
  for (var key in expression) {
23849
- if (key == '$') {
23850
- (function() {
23851
- if (!expression[key]) return;
23852
- var path = key;
23853
- predicates.push(function(value) {
23854
- return search(value, expression[path]);
23855
- });
23856
- })();
23857
- } else {
23858
- (function() {
23859
- if (typeof(expression[key]) == 'undefined') { return; }
23860
- var path = key;
23861
- predicates.push(function(value) {
23862
- return search(getter(value,path), expression[path]);
23863
- });
23864
- })();
23865
- }
23874
+ (function(path) {
23875
+ if (typeof expression[path] == 'undefined') return;
23876
+ predicates.push(function(value) {
23877
+ return search(path == '$' ? value : getter(value, path), expression[path]);
23878
+ });
23879
+ })(key);
23866
23880
  }
23867
23881
  break;
23868
23882
  case 'function':
@@ -24983,12 +24997,10 @@ forEach(BOOLEAN_ATTR, function(propName, attrName) {
24983
24997
  ngAttributeAliasDirectives[normalized] = function() {
24984
24998
  return {
24985
24999
  priority: 100,
24986
- compile: function() {
24987
- return function(scope, element, attr) {
24988
- scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
24989
- attr.$set(attrName, !!value);
24990
- });
24991
- };
25000
+ link: function(scope, element, attr) {
25001
+ scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
25002
+ attr.$set(attrName, !!value);
25003
+ });
24992
25004
  }
24993
25005
  };
24994
25006
  };
@@ -25268,10 +25280,10 @@ function FormController(element, attrs) {
25268
25280
  *
25269
25281
  *
25270
25282
  * # CSS classes
25271
- * - `ng-valid` Is set if the form is valid.
25272
- * - `ng-invalid` Is set if the form is invalid.
25273
- * - `ng-pristine` Is set if the form is pristine.
25274
- * - `ng-dirty` Is set if the form is dirty.
25283
+ * - `ng-valid` is set if the form is valid.
25284
+ * - `ng-invalid` is set if the form is invalid.
25285
+ * - `ng-pristine` is set if the form is pristine.
25286
+ * - `ng-dirty` is set if the form is dirty.
25275
25287
  *
25276
25288
  *
25277
25289
  * # Submitting a form and preventing the default action
@@ -25788,6 +25800,12 @@ var inputType = {
25788
25800
  'reset': noop
25789
25801
  };
25790
25802
 
25803
+ // A helper function to call $setValidity and return the value / undefined,
25804
+ // a pattern that is repeated a lot in the input validation logic.
25805
+ function validate(ctrl, validatorName, validity, value){
25806
+ ctrl.$setValidity(validatorName, validity);
25807
+ return validity ? value : undefined;
25808
+ }
25791
25809
 
25792
25810
  function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
25793
25811
  // In composition mode, users are still inputing intermediate text buffer,
@@ -25872,22 +25890,15 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
25872
25890
  patternValidator,
25873
25891
  match;
25874
25892
 
25875
- var validate = function(regexp, value) {
25876
- if (ctrl.$isEmpty(value) || regexp.test(value)) {
25877
- ctrl.$setValidity('pattern', true);
25878
- return value;
25879
- } else {
25880
- ctrl.$setValidity('pattern', false);
25881
- return undefined;
25882
- }
25883
- };
25884
-
25885
25893
  if (pattern) {
25894
+ var validateRegex = function(regexp, value) {
25895
+ return validate(ctrl, 'pattern', ctrl.$isEmpty(value) || regexp.test(value), value);
25896
+ };
25886
25897
  match = pattern.match(/^\/(.*)\/([gim]*)$/);
25887
25898
  if (match) {
25888
25899
  pattern = new RegExp(match[1], match[2]);
25889
25900
  patternValidator = function(value) {
25890
- return validate(pattern, value);
25901
+ return validateRegex(pattern, value);
25891
25902
  };
25892
25903
  } else {
25893
25904
  patternValidator = function(value) {
@@ -25898,7 +25909,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
25898
25909
  'Expected {0} to be a RegExp but was {1}. Element: {2}', pattern,
25899
25910
  patternObj, startingTag(element));
25900
25911
  }
25901
- return validate(patternObj, value);
25912
+ return validateRegex(patternObj, value);
25902
25913
  };
25903
25914
  }
25904
25915
 
@@ -25910,13 +25921,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
25910
25921
  if (attr.ngMinlength) {
25911
25922
  var minlength = int(attr.ngMinlength);
25912
25923
  var minLengthValidator = function(value) {
25913
- if (!ctrl.$isEmpty(value) && value.length < minlength) {
25914
- ctrl.$setValidity('minlength', false);
25915
- return undefined;
25916
- } else {
25917
- ctrl.$setValidity('minlength', true);
25918
- return value;
25919
- }
25924
+ return validate(ctrl, 'minlength', ctrl.$isEmpty(value) || value.length >= minlength, value);
25920
25925
  };
25921
25926
 
25922
25927
  ctrl.$parsers.push(minLengthValidator);
@@ -25927,13 +25932,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
25927
25932
  if (attr.ngMaxlength) {
25928
25933
  var maxlength = int(attr.ngMaxlength);
25929
25934
  var maxLengthValidator = function(value) {
25930
- if (!ctrl.$isEmpty(value) && value.length > maxlength) {
25931
- ctrl.$setValidity('maxlength', false);
25932
- return undefined;
25933
- } else {
25934
- ctrl.$setValidity('maxlength', true);
25935
- return value;
25936
- }
25935
+ return validate(ctrl, 'maxlength', ctrl.$isEmpty(value) || value.length <= maxlength, value);
25937
25936
  };
25938
25937
 
25939
25938
  ctrl.$parsers.push(maxLengthValidator);
@@ -25962,13 +25961,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
25962
25961
  if (attr.min) {
25963
25962
  var minValidator = function(value) {
25964
25963
  var min = parseFloat(attr.min);
25965
- if (!ctrl.$isEmpty(value) && value < min) {
25966
- ctrl.$setValidity('min', false);
25967
- return undefined;
25968
- } else {
25969
- ctrl.$setValidity('min', true);
25970
- return value;
25971
- }
25964
+ return validate(ctrl, 'min', ctrl.$isEmpty(value) || value >= min, value);
25972
25965
  };
25973
25966
 
25974
25967
  ctrl.$parsers.push(minValidator);
@@ -25978,13 +25971,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
25978
25971
  if (attr.max) {
25979
25972
  var maxValidator = function(value) {
25980
25973
  var max = parseFloat(attr.max);
25981
- if (!ctrl.$isEmpty(value) && value > max) {
25982
- ctrl.$setValidity('max', false);
25983
- return undefined;
25984
- } else {
25985
- ctrl.$setValidity('max', true);
25986
- return value;
25987
- }
25974
+ return validate(ctrl, 'max', ctrl.$isEmpty(value) || value <= max, value);
25988
25975
  };
25989
25976
 
25990
25977
  ctrl.$parsers.push(maxValidator);
@@ -25992,14 +25979,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
25992
25979
  }
25993
25980
 
25994
25981
  ctrl.$formatters.push(function(value) {
25995
-
25996
- if (ctrl.$isEmpty(value) || isNumber(value)) {
25997
- ctrl.$setValidity('number', true);
25998
- return value;
25999
- } else {
26000
- ctrl.$setValidity('number', false);
26001
- return undefined;
26002
- }
25982
+ return validate(ctrl, 'number', ctrl.$isEmpty(value) || isNumber(value), value);
26003
25983
  });
26004
25984
  }
26005
25985
 
@@ -26007,13 +25987,7 @@ function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
26007
25987
  textInputType(scope, element, attr, ctrl, $sniffer, $browser);
26008
25988
 
26009
25989
  var urlValidator = function(value) {
26010
- if (ctrl.$isEmpty(value) || URL_REGEXP.test(value)) {
26011
- ctrl.$setValidity('url', true);
26012
- return value;
26013
- } else {
26014
- ctrl.$setValidity('url', false);
26015
- return undefined;
26016
- }
25990
+ return validate(ctrl, 'url', ctrl.$isEmpty(value) || URL_REGEXP.test(value), value);
26017
25991
  };
26018
25992
 
26019
25993
  ctrl.$formatters.push(urlValidator);
@@ -26024,13 +25998,7 @@ function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
26024
25998
  textInputType(scope, element, attr, ctrl, $sniffer, $browser);
26025
25999
 
26026
26000
  var emailValidator = function(value) {
26027
- if (ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value)) {
26028
- ctrl.$setValidity('email', true);
26029
- return value;
26030
- } else {
26031
- ctrl.$setValidity('email', false);
26032
- return undefined;
26033
- }
26001
+ return validate(ctrl, 'email', ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value), value);
26034
26002
  };
26035
26003
 
26036
26004
  ctrl.$formatters.push(emailValidator);
@@ -27634,13 +27602,13 @@ var ngControllerDirective = [function() {
27634
27602
  </button>
27635
27603
  count: {{count}}
27636
27604
  </doc:source>
27637
- <doc:scenario>
27605
+ <doc:protractor>
27638
27606
  it('should check ng-click', function() {
27639
- expect(binding('count')).toBe('0');
27640
- element('.doc-example-live :button').click();
27641
- expect(binding('count')).toBe('1');
27607
+ expect(element(by.binding('count')).getText()).toMatch('0');
27608
+ element(by.css('.doc-example-live button')).click();
27609
+ expect(element(by.binding('count')).getText()).toMatch('1');
27642
27610
  });
27643
- </doc:scenario>
27611
+ </doc:protractor>
27644
27612
  </doc:example>
27645
27613
  */
27646
27614
  /*
@@ -28719,6 +28687,8 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp
28719
28687
  * | `$even` | {@type boolean} | true if the iterator position `$index` is even (otherwise false). |
28720
28688
  * | `$odd` | {@type boolean} | true if the iterator position `$index` is odd (otherwise false). |
28721
28689
  *
28690
+ * Creating aliases for these properties is possible with {@link api/ng.directive:ngInit `ngInit`}.
28691
+ * This may be useful when, for instance, nesting ngRepeats.
28722
28692
  *
28723
28693
  * # Special repeat start and end points
28724
28694
  * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending
@@ -29601,11 +29571,9 @@ var ngSwitchWhenDirective = ngDirective({
29601
29571
  transclude: 'element',
29602
29572
  priority: 800,
29603
29573
  require: '^ngSwitch',
29604
- compile: function(element, attrs) {
29605
- return function(scope, element, attr, ctrl, $transclude) {
29606
- ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);
29607
- ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });
29608
- };
29574
+ link: function(scope, element, attrs, ctrl, $transclude) {
29575
+ ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);
29576
+ ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });
29609
29577
  }
29610
29578
  });
29611
29579
 
@@ -29700,10 +29668,14 @@ var ngTranscludeDirective = ngDirective({
29700
29668
  * @restrict E
29701
29669
  *
29702
29670
  * @description
29703
- * Load content of a script tag, with type `text/ng-template`, into `$templateCache`, so that the
29704
- * template can be used by `ngInclude`, `ngView` or directive templates.
29671
+ * Load the content of a `<script>` element into {@link api/ng.$templateCache `$templateCache`}, so that the
29672
+ * template can be used by {@link api/ng.directive:ngInclude `ngInclude`},
29673
+ * {@link api/ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the
29674
+ * `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be
29675
+ * assigned through the element's `id`, which can then be used as a directive's `templateUrl`.
29705
29676
  *
29706
- * @param {'text/ng-template'} type must be set to `'text/ng-template'`
29677
+ * @param {'text/ng-template'} type Must be set to `'text/ng-template'`.
29678
+ * @param {string} id Cache name of the template.
29707
29679
  *
29708
29680
  * @example
29709
29681
  <doc:example>
@@ -29867,8 +29839,8 @@ var ngOptionsMinErr = minErr('ngOptions');
29867
29839
  var ngOptionsDirective = valueFn({ terminal: true });
29868
29840
  // jshint maxlen: false
29869
29841
  var selectDirective = ['$compile', '$parse', function($compile, $parse) {
29870
- //0000111110000000000022220000000000000000000000333300000000000000444444444444444000000000555555555555555000000066666666666666600000000000000007777000000000000000000088888
29871
- var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/,
29842
+ //000011111111110000000000022222222220000000000000000000003333333333000000000000004444444444444440000000005555555555555550000000666666666666666000000000000000777777777700000000000000000008888888888
29843
+ var NG_OPTIONS_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
29872
29844
  nullModelCtrl = {$setViewValue: noop};
29873
29845
  // jshint maxlen: 100
29874
29846