angular-gem 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/angular-gem/version.rb +1 -1
- data/vendor/assets/javascripts/1.2.8/angular-animate.js +1380 -0
- data/vendor/assets/javascripts/1.2.8/angular-cookies.js +202 -0
- data/vendor/assets/javascripts/1.2.8/angular-loader.js +410 -0
- data/vendor/assets/javascripts/1.2.8/angular-mocks.js +2136 -0
- data/vendor/assets/javascripts/1.2.8/angular-resource.js +594 -0
- data/vendor/assets/javascripts/1.2.8/angular-route.js +911 -0
- data/vendor/assets/javascripts/1.2.8/angular-sanitize.js +622 -0
- data/vendor/assets/javascripts/1.2.8/angular-scenario.js +32560 -0
- data/vendor/assets/javascripts/1.2.8/angular-touch.js +563 -0
- data/vendor/assets/javascripts/1.2.8/angular.js +20554 -0
- data/vendor/assets/javascripts/angular-animate.js +1 -1
- data/vendor/assets/javascripts/angular-cookies.js +1 -1
- data/vendor/assets/javascripts/angular-loader.js +2 -2
- data/vendor/assets/javascripts/angular-mocks.js +18 -2
- data/vendor/assets/javascripts/angular-resource.js +2 -2
- data/vendor/assets/javascripts/angular-route.js +1 -1
- data/vendor/assets/javascripts/angular-sanitize.js +1 -1
- data/vendor/assets/javascripts/angular-scenario.js +103 -137
- data/vendor/assets/javascripts/angular-touch.js +1 -1
- data/vendor/assets/javascripts/angular.js +103 -137
- metadata +11 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license AngularJS v1.2.
|
|
2
|
+
* @license AngularJS v1.2.8
|
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -68,7 +68,7 @@ function minErr(module) {
|
|
|
68
68
|
return match;
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
message = message + '\nhttp://errors.angularjs.org/1.2.
|
|
71
|
+
message = message + '\nhttp://errors.angularjs.org/1.2.8/' +
|
|
72
72
|
(module ? module + '/' : '') + code;
|
|
73
73
|
for (i = 2; i < arguments.length; i++) {
|
|
74
74
|
message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
|
|
@@ -1833,11 +1833,11 @@ function setupModuleLoader(window) {
|
|
|
1833
1833
|
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
|
|
1834
1834
|
*/
|
|
1835
1835
|
var version = {
|
|
1836
|
-
full: '1.2.
|
|
1836
|
+
full: '1.2.8', // all of these placeholder strings will be replaced by grunt's
|
|
1837
1837
|
major: 1, // package task
|
|
1838
1838
|
minor: 2,
|
|
1839
|
-
dot:
|
|
1840
|
-
codeName: '
|
|
1839
|
+
dot: 8,
|
|
1840
|
+
codeName: 'interdimensional-cartography'
|
|
1841
1841
|
};
|
|
1842
1842
|
|
|
1843
1843
|
|
|
@@ -6648,7 +6648,7 @@ function directiveNormalize(name) {
|
|
|
6648
6648
|
*
|
|
6649
6649
|
*
|
|
6650
6650
|
* @param {string} name Normalized element attribute name of the property to modify. The name is
|
|
6651
|
-
*
|
|
6651
|
+
* reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}
|
|
6652
6652
|
* property to the original name.
|
|
6653
6653
|
* @param {string} value Value to set the attribute to. The value can be an interpolated string.
|
|
6654
6654
|
*/
|
|
@@ -6786,8 +6786,7 @@ function $ControllerProvider() {
|
|
|
6786
6786
|
* @requires $window
|
|
6787
6787
|
*
|
|
6788
6788
|
* @description
|
|
6789
|
-
* A {@link angular.element jQuery
|
|
6790
|
-
* element.
|
|
6789
|
+
* A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.
|
|
6791
6790
|
*/
|
|
6792
6791
|
function $DocumentProvider(){
|
|
6793
6792
|
this.$get = ['$window', function(window){
|
|
@@ -7126,7 +7125,15 @@ function $HttpProvider() {
|
|
|
7126
7125
|
* `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }.
|
|
7127
7126
|
*
|
|
7128
7127
|
* The defaults can also be set at runtime via the `$http.defaults` object in the same
|
|
7129
|
-
* fashion.
|
|
7128
|
+
* fashion. For example:
|
|
7129
|
+
*
|
|
7130
|
+
* ```
|
|
7131
|
+
* module.run(function($http) {
|
|
7132
|
+
* $http.defaults.headers.common.Authentication = 'Basic YmVlcDpib29w'
|
|
7133
|
+
* });
|
|
7134
|
+
* ```
|
|
7135
|
+
*
|
|
7136
|
+
* In addition, you can supply a `headers` property in the config object passed when
|
|
7130
7137
|
* calling `$http(config)`, which overrides the defaults without changing them globally.
|
|
7131
7138
|
*
|
|
7132
7139
|
*
|
|
@@ -7150,7 +7157,9 @@ function $HttpProvider() {
|
|
|
7150
7157
|
* properties. These properties are by default an array of transform functions, which allows you
|
|
7151
7158
|
* to `push` or `unshift` a new transformation function into the transformation chain. You can
|
|
7152
7159
|
* also decide to completely override any default transformations by assigning your
|
|
7153
|
-
* transformation functions to these properties directly without the array wrapper.
|
|
7160
|
+
* transformation functions to these properties directly without the array wrapper. These defaults
|
|
7161
|
+
* are again available on the $http factory at run-time, which may be useful if you have run-time
|
|
7162
|
+
* services you wish to be involved in your transformations.
|
|
7154
7163
|
*
|
|
7155
7164
|
* Similarly, to locally override the request/response transforms, augment the
|
|
7156
7165
|
* `transformRequest` and/or `transformResponse` properties of the configuration object passed
|
|
@@ -7364,7 +7373,8 @@ function $HttpProvider() {
|
|
|
7364
7373
|
* for added security.
|
|
7365
7374
|
*
|
|
7366
7375
|
* The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
|
|
7367
|
-
* properties of either $httpProvider.defaults,
|
|
7376
|
+
* properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,
|
|
7377
|
+
* or the per-request config object.
|
|
7368
7378
|
*
|
|
7369
7379
|
*
|
|
7370
7380
|
* @param {object} config Object describing the request to be made and how it should be
|
|
@@ -7927,7 +7937,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
|
|
7927
7937
|
} else {
|
|
7928
7938
|
completeRequest(callback, status || -2);
|
|
7929
7939
|
}
|
|
7930
|
-
|
|
7940
|
+
callbacks[callbackId] = angular.noop;
|
|
7931
7941
|
});
|
|
7932
7942
|
} else {
|
|
7933
7943
|
|
|
@@ -7944,7 +7954,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
|
|
7944
7954
|
// response is in the cache. the promise api will ensure that to the app code the api is
|
|
7945
7955
|
// always async
|
|
7946
7956
|
xhr.onreadystatechange = function() {
|
|
7947
|
-
// onreadystatechange might
|
|
7957
|
+
// onreadystatechange might get called multiple times with readyState === 4 on mobile webkit caused by
|
|
7948
7958
|
// xhrs that are resolved while the app is in the background (see #5426).
|
|
7949
7959
|
// since calling completeRequest sets the `xhr` variable to null, we just check if it's not null before
|
|
7950
7960
|
// continuing
|
|
@@ -7957,11 +7967,12 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
|
|
7957
7967
|
|
|
7958
7968
|
if(status !== ABORTED) {
|
|
7959
7969
|
responseHeaders = xhr.getAllResponseHeaders();
|
|
7960
|
-
|
|
7970
|
+
|
|
7971
|
+
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
|
|
7972
|
+
// response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
|
|
7973
|
+
response = ('response' in xhr) ? xhr.response : xhr.responseText;
|
|
7961
7974
|
}
|
|
7962
7975
|
|
|
7963
|
-
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
|
|
7964
|
-
// response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
|
|
7965
7976
|
completeRequest(callback,
|
|
7966
7977
|
status || xhr.status,
|
|
7967
7978
|
response,
|
|
@@ -7994,14 +8005,14 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
|
|
7994
8005
|
}
|
|
7995
8006
|
|
|
7996
8007
|
function completeRequest(callback, status, response, headersString) {
|
|
7997
|
-
var protocol = urlResolve(url).protocol;
|
|
7998
|
-
|
|
7999
8008
|
// cancel timeout and subsequent timeout promise resolution
|
|
8000
8009
|
timeoutId && $browserDefer.cancel(timeoutId);
|
|
8001
8010
|
jsonpDone = xhr = null;
|
|
8002
8011
|
|
|
8003
|
-
// fix status code
|
|
8004
|
-
|
|
8012
|
+
// fix status code when it is 0 (0 status is undocumented).
|
|
8013
|
+
// Occurs when accessing file resources.
|
|
8014
|
+
// On Android 4.1 stock browser it occurs while retrieving files from application cache.
|
|
8015
|
+
status = (status === 0) ? (response ? 200 : 404) : status;
|
|
8005
8016
|
|
|
8006
8017
|
// normalize IE bug (http://bugs.jquery.com/ticket/1450)
|
|
8007
8018
|
status = status == 1223 ? 204 : status;
|
|
@@ -9115,7 +9126,7 @@ function $LocationProvider(){
|
|
|
9115
9126
|
* Broadcasted before a URL will change. This change can be prevented by calling
|
|
9116
9127
|
* `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
|
|
9117
9128
|
* details about event object. Upon successful change
|
|
9118
|
-
* {@link ng.$location
|
|
9129
|
+
* {@link ng.$location#events_$locationChangeSuccess $locationChangeSuccess} is fired.
|
|
9119
9130
|
*
|
|
9120
9131
|
* @param {Object} angularEvent Synthetic event object.
|
|
9121
9132
|
* @param {string} newUrl New URL
|
|
@@ -10306,16 +10317,20 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
|
|
|
10306
10317
|
if (pathVal == null) return pathVal;
|
|
10307
10318
|
pathVal = pathVal[key0];
|
|
10308
10319
|
|
|
10309
|
-
if (
|
|
10320
|
+
if (!key1) return pathVal;
|
|
10321
|
+
if (pathVal == null) return undefined;
|
|
10310
10322
|
pathVal = pathVal[key1];
|
|
10311
10323
|
|
|
10312
|
-
if (
|
|
10324
|
+
if (!key2) return pathVal;
|
|
10325
|
+
if (pathVal == null) return undefined;
|
|
10313
10326
|
pathVal = pathVal[key2];
|
|
10314
10327
|
|
|
10315
|
-
if (
|
|
10328
|
+
if (!key3) return pathVal;
|
|
10329
|
+
if (pathVal == null) return undefined;
|
|
10316
10330
|
pathVal = pathVal[key3];
|
|
10317
10331
|
|
|
10318
|
-
if (
|
|
10332
|
+
if (!key4) return pathVal;
|
|
10333
|
+
if (pathVal == null) return undefined;
|
|
10319
10334
|
pathVal = pathVal[key4];
|
|
10320
10335
|
|
|
10321
10336
|
return pathVal;
|
|
@@ -10336,8 +10351,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
|
|
|
10336
10351
|
}
|
|
10337
10352
|
pathVal = pathVal.$$v;
|
|
10338
10353
|
}
|
|
10339
|
-
if (pathVal == null) return key1 ? undefined : pathVal;
|
|
10340
10354
|
|
|
10355
|
+
if (!key1) return pathVal;
|
|
10356
|
+
if (pathVal == null) return undefined;
|
|
10341
10357
|
pathVal = pathVal[key1];
|
|
10342
10358
|
if (pathVal && pathVal.then) {
|
|
10343
10359
|
promiseWarning(fullExp);
|
|
@@ -10348,8 +10364,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
|
|
|
10348
10364
|
}
|
|
10349
10365
|
pathVal = pathVal.$$v;
|
|
10350
10366
|
}
|
|
10351
|
-
if (pathVal == null) return key2 ? undefined : pathVal;
|
|
10352
10367
|
|
|
10368
|
+
if (!key2) return pathVal;
|
|
10369
|
+
if (pathVal == null) return undefined;
|
|
10353
10370
|
pathVal = pathVal[key2];
|
|
10354
10371
|
if (pathVal && pathVal.then) {
|
|
10355
10372
|
promiseWarning(fullExp);
|
|
@@ -10360,8 +10377,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
|
|
|
10360
10377
|
}
|
|
10361
10378
|
pathVal = pathVal.$$v;
|
|
10362
10379
|
}
|
|
10363
|
-
if (pathVal == null) return key3 ? undefined : pathVal;
|
|
10364
10380
|
|
|
10381
|
+
if (!key3) return pathVal;
|
|
10382
|
+
if (pathVal == null) return undefined;
|
|
10365
10383
|
pathVal = pathVal[key3];
|
|
10366
10384
|
if (pathVal && pathVal.then) {
|
|
10367
10385
|
promiseWarning(fullExp);
|
|
@@ -10372,8 +10390,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
|
|
|
10372
10390
|
}
|
|
10373
10391
|
pathVal = pathVal.$$v;
|
|
10374
10392
|
}
|
|
10375
|
-
if (pathVal == null) return key4 ? undefined : pathVal;
|
|
10376
10393
|
|
|
10394
|
+
if (!key4) return pathVal;
|
|
10395
|
+
if (pathVal == null) return undefined;
|
|
10377
10396
|
pathVal = pathVal[key4];
|
|
10378
10397
|
if (pathVal && pathVal.then) {
|
|
10379
10398
|
promiseWarning(fullExp);
|
|
@@ -11371,7 +11390,7 @@ function $RootScopeProvider(){
|
|
|
11371
11390
|
} else {
|
|
11372
11391
|
ChildScope = function() {}; // should be anonymous; This is so that when the minifier munges
|
|
11373
11392
|
// the name it does not become random set of chars. This will then show up as class
|
|
11374
|
-
// name in the
|
|
11393
|
+
// name in the web inspector.
|
|
11375
11394
|
ChildScope.prototype = this;
|
|
11376
11395
|
child = new ChildScope();
|
|
11377
11396
|
child.$id = nextUid();
|
|
@@ -11472,7 +11491,7 @@ function $RootScopeProvider(){
|
|
|
11472
11491
|
// No digest has been run so the counter will be zero
|
|
11473
11492
|
expect(scope.foodCounter).toEqual(0);
|
|
11474
11493
|
|
|
11475
|
-
// Run the digest but since food has not changed
|
|
11494
|
+
// Run the digest but since food has not changed count will still be zero
|
|
11476
11495
|
scope.$digest();
|
|
11477
11496
|
expect(scope.foodCounter).toEqual(0);
|
|
11478
11497
|
|
|
@@ -13895,8 +13914,8 @@ function $FilterProvider($provide) {
|
|
|
13895
13914
|
*
|
|
13896
13915
|
* Can be one of:
|
|
13897
13916
|
*
|
|
13898
|
-
* - `string`:
|
|
13899
|
-
*
|
|
13917
|
+
* - `string`: The string is evaluated as an expression and the resulting value is used for substring match against
|
|
13918
|
+
* the contents of the `array`. All strings or objects with string properties in `array` that contain this string
|
|
13900
13919
|
* will be returned. The predicate can be negated by prefixing the string with `!`.
|
|
13901
13920
|
*
|
|
13902
13921
|
* - `Object`: A pattern object can be used to filter specific properties on objects contained
|
|
@@ -14054,23 +14073,12 @@ function filterFilter() {
|
|
|
14054
14073
|
case "object":
|
|
14055
14074
|
// jshint +W086
|
|
14056
14075
|
for (var key in expression) {
|
|
14057
|
-
|
|
14058
|
-
(
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
});
|
|
14064
|
-
})();
|
|
14065
|
-
} else {
|
|
14066
|
-
(function() {
|
|
14067
|
-
if (typeof(expression[key]) == 'undefined') { return; }
|
|
14068
|
-
var path = key;
|
|
14069
|
-
predicates.push(function(value) {
|
|
14070
|
-
return search(getter(value,path), expression[path]);
|
|
14071
|
-
});
|
|
14072
|
-
})();
|
|
14073
|
-
}
|
|
14076
|
+
(function(path) {
|
|
14077
|
+
if (typeof expression[path] == 'undefined') return;
|
|
14078
|
+
predicates.push(function(value) {
|
|
14079
|
+
return search(path == '$' ? value : getter(value, path), expression[path]);
|
|
14080
|
+
});
|
|
14081
|
+
})(key);
|
|
14074
14082
|
}
|
|
14075
14083
|
break;
|
|
14076
14084
|
case 'function':
|
|
@@ -15191,12 +15199,10 @@ forEach(BOOLEAN_ATTR, function(propName, attrName) {
|
|
|
15191
15199
|
ngAttributeAliasDirectives[normalized] = function() {
|
|
15192
15200
|
return {
|
|
15193
15201
|
priority: 100,
|
|
15194
|
-
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
|
|
15198
|
-
});
|
|
15199
|
-
};
|
|
15202
|
+
link: function(scope, element, attr) {
|
|
15203
|
+
scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
|
|
15204
|
+
attr.$set(attrName, !!value);
|
|
15205
|
+
});
|
|
15200
15206
|
}
|
|
15201
15207
|
};
|
|
15202
15208
|
};
|
|
@@ -15476,10 +15482,10 @@ function FormController(element, attrs) {
|
|
|
15476
15482
|
*
|
|
15477
15483
|
*
|
|
15478
15484
|
* # CSS classes
|
|
15479
|
-
* - `ng-valid`
|
|
15480
|
-
* - `ng-invalid`
|
|
15481
|
-
* - `ng-pristine`
|
|
15482
|
-
* - `ng-dirty`
|
|
15485
|
+
* - `ng-valid` is set if the form is valid.
|
|
15486
|
+
* - `ng-invalid` is set if the form is invalid.
|
|
15487
|
+
* - `ng-pristine` is set if the form is pristine.
|
|
15488
|
+
* - `ng-dirty` is set if the form is dirty.
|
|
15483
15489
|
*
|
|
15484
15490
|
*
|
|
15485
15491
|
* # Submitting a form and preventing the default action
|
|
@@ -15996,6 +16002,12 @@ var inputType = {
|
|
|
15996
16002
|
'reset': noop
|
|
15997
16003
|
};
|
|
15998
16004
|
|
|
16005
|
+
// A helper function to call $setValidity and return the value / undefined,
|
|
16006
|
+
// a pattern that is repeated a lot in the input validation logic.
|
|
16007
|
+
function validate(ctrl, validatorName, validity, value){
|
|
16008
|
+
ctrl.$setValidity(validatorName, validity);
|
|
16009
|
+
return validity ? value : undefined;
|
|
16010
|
+
}
|
|
15999
16011
|
|
|
16000
16012
|
function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
16001
16013
|
// In composition mode, users are still inputing intermediate text buffer,
|
|
@@ -16080,22 +16092,15 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
16080
16092
|
patternValidator,
|
|
16081
16093
|
match;
|
|
16082
16094
|
|
|
16083
|
-
var validate = function(regexp, value) {
|
|
16084
|
-
if (ctrl.$isEmpty(value) || regexp.test(value)) {
|
|
16085
|
-
ctrl.$setValidity('pattern', true);
|
|
16086
|
-
return value;
|
|
16087
|
-
} else {
|
|
16088
|
-
ctrl.$setValidity('pattern', false);
|
|
16089
|
-
return undefined;
|
|
16090
|
-
}
|
|
16091
|
-
};
|
|
16092
|
-
|
|
16093
16095
|
if (pattern) {
|
|
16096
|
+
var validateRegex = function(regexp, value) {
|
|
16097
|
+
return validate(ctrl, 'pattern', ctrl.$isEmpty(value) || regexp.test(value), value);
|
|
16098
|
+
};
|
|
16094
16099
|
match = pattern.match(/^\/(.*)\/([gim]*)$/);
|
|
16095
16100
|
if (match) {
|
|
16096
16101
|
pattern = new RegExp(match[1], match[2]);
|
|
16097
16102
|
patternValidator = function(value) {
|
|
16098
|
-
return
|
|
16103
|
+
return validateRegex(pattern, value);
|
|
16099
16104
|
};
|
|
16100
16105
|
} else {
|
|
16101
16106
|
patternValidator = function(value) {
|
|
@@ -16106,7 +16111,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
16106
16111
|
'Expected {0} to be a RegExp but was {1}. Element: {2}', pattern,
|
|
16107
16112
|
patternObj, startingTag(element));
|
|
16108
16113
|
}
|
|
16109
|
-
return
|
|
16114
|
+
return validateRegex(patternObj, value);
|
|
16110
16115
|
};
|
|
16111
16116
|
}
|
|
16112
16117
|
|
|
@@ -16118,13 +16123,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
16118
16123
|
if (attr.ngMinlength) {
|
|
16119
16124
|
var minlength = int(attr.ngMinlength);
|
|
16120
16125
|
var minLengthValidator = function(value) {
|
|
16121
|
-
|
|
16122
|
-
ctrl.$setValidity('minlength', false);
|
|
16123
|
-
return undefined;
|
|
16124
|
-
} else {
|
|
16125
|
-
ctrl.$setValidity('minlength', true);
|
|
16126
|
-
return value;
|
|
16127
|
-
}
|
|
16126
|
+
return validate(ctrl, 'minlength', ctrl.$isEmpty(value) || value.length >= minlength, value);
|
|
16128
16127
|
};
|
|
16129
16128
|
|
|
16130
16129
|
ctrl.$parsers.push(minLengthValidator);
|
|
@@ -16135,13 +16134,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
16135
16134
|
if (attr.ngMaxlength) {
|
|
16136
16135
|
var maxlength = int(attr.ngMaxlength);
|
|
16137
16136
|
var maxLengthValidator = function(value) {
|
|
16138
|
-
|
|
16139
|
-
ctrl.$setValidity('maxlength', false);
|
|
16140
|
-
return undefined;
|
|
16141
|
-
} else {
|
|
16142
|
-
ctrl.$setValidity('maxlength', true);
|
|
16143
|
-
return value;
|
|
16144
|
-
}
|
|
16137
|
+
return validate(ctrl, 'maxlength', ctrl.$isEmpty(value) || value.length <= maxlength, value);
|
|
16145
16138
|
};
|
|
16146
16139
|
|
|
16147
16140
|
ctrl.$parsers.push(maxLengthValidator);
|
|
@@ -16170,13 +16163,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
16170
16163
|
if (attr.min) {
|
|
16171
16164
|
var minValidator = function(value) {
|
|
16172
16165
|
var min = parseFloat(attr.min);
|
|
16173
|
-
|
|
16174
|
-
ctrl.$setValidity('min', false);
|
|
16175
|
-
return undefined;
|
|
16176
|
-
} else {
|
|
16177
|
-
ctrl.$setValidity('min', true);
|
|
16178
|
-
return value;
|
|
16179
|
-
}
|
|
16166
|
+
return validate(ctrl, 'min', ctrl.$isEmpty(value) || value >= min, value);
|
|
16180
16167
|
};
|
|
16181
16168
|
|
|
16182
16169
|
ctrl.$parsers.push(minValidator);
|
|
@@ -16186,13 +16173,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
16186
16173
|
if (attr.max) {
|
|
16187
16174
|
var maxValidator = function(value) {
|
|
16188
16175
|
var max = parseFloat(attr.max);
|
|
16189
|
-
|
|
16190
|
-
ctrl.$setValidity('max', false);
|
|
16191
|
-
return undefined;
|
|
16192
|
-
} else {
|
|
16193
|
-
ctrl.$setValidity('max', true);
|
|
16194
|
-
return value;
|
|
16195
|
-
}
|
|
16176
|
+
return validate(ctrl, 'max', ctrl.$isEmpty(value) || value <= max, value);
|
|
16196
16177
|
};
|
|
16197
16178
|
|
|
16198
16179
|
ctrl.$parsers.push(maxValidator);
|
|
@@ -16200,14 +16181,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
16200
16181
|
}
|
|
16201
16182
|
|
|
16202
16183
|
ctrl.$formatters.push(function(value) {
|
|
16203
|
-
|
|
16204
|
-
if (ctrl.$isEmpty(value) || isNumber(value)) {
|
|
16205
|
-
ctrl.$setValidity('number', true);
|
|
16206
|
-
return value;
|
|
16207
|
-
} else {
|
|
16208
|
-
ctrl.$setValidity('number', false);
|
|
16209
|
-
return undefined;
|
|
16210
|
-
}
|
|
16184
|
+
return validate(ctrl, 'number', ctrl.$isEmpty(value) || isNumber(value), value);
|
|
16211
16185
|
});
|
|
16212
16186
|
}
|
|
16213
16187
|
|
|
@@ -16215,13 +16189,7 @@ function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
16215
16189
|
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
|
|
16216
16190
|
|
|
16217
16191
|
var urlValidator = function(value) {
|
|
16218
|
-
|
|
16219
|
-
ctrl.$setValidity('url', true);
|
|
16220
|
-
return value;
|
|
16221
|
-
} else {
|
|
16222
|
-
ctrl.$setValidity('url', false);
|
|
16223
|
-
return undefined;
|
|
16224
|
-
}
|
|
16192
|
+
return validate(ctrl, 'url', ctrl.$isEmpty(value) || URL_REGEXP.test(value), value);
|
|
16225
16193
|
};
|
|
16226
16194
|
|
|
16227
16195
|
ctrl.$formatters.push(urlValidator);
|
|
@@ -16232,13 +16200,7 @@ function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
16232
16200
|
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
|
|
16233
16201
|
|
|
16234
16202
|
var emailValidator = function(value) {
|
|
16235
|
-
|
|
16236
|
-
ctrl.$setValidity('email', true);
|
|
16237
|
-
return value;
|
|
16238
|
-
} else {
|
|
16239
|
-
ctrl.$setValidity('email', false);
|
|
16240
|
-
return undefined;
|
|
16241
|
-
}
|
|
16203
|
+
return validate(ctrl, 'email', ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value), value);
|
|
16242
16204
|
};
|
|
16243
16205
|
|
|
16244
16206
|
ctrl.$formatters.push(emailValidator);
|
|
@@ -17842,13 +17804,13 @@ var ngControllerDirective = [function() {
|
|
|
17842
17804
|
</button>
|
|
17843
17805
|
count: {{count}}
|
|
17844
17806
|
</doc:source>
|
|
17845
|
-
<doc:
|
|
17807
|
+
<doc:protractor>
|
|
17846
17808
|
it('should check ng-click', function() {
|
|
17847
|
-
expect(binding('count')).
|
|
17848
|
-
element('.doc-example-live
|
|
17849
|
-
expect(binding('count')).
|
|
17809
|
+
expect(element(by.binding('count')).getText()).toMatch('0');
|
|
17810
|
+
element(by.css('.doc-example-live button')).click();
|
|
17811
|
+
expect(element(by.binding('count')).getText()).toMatch('1');
|
|
17850
17812
|
});
|
|
17851
|
-
</doc:
|
|
17813
|
+
</doc:protractor>
|
|
17852
17814
|
</doc:example>
|
|
17853
17815
|
*/
|
|
17854
17816
|
/*
|
|
@@ -18927,6 +18889,8 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp
|
|
|
18927
18889
|
* | `$even` | {@type boolean} | true if the iterator position `$index` is even (otherwise false). |
|
|
18928
18890
|
* | `$odd` | {@type boolean} | true if the iterator position `$index` is odd (otherwise false). |
|
|
18929
18891
|
*
|
|
18892
|
+
* Creating aliases for these properties is possible with {@link api/ng.directive:ngInit `ngInit`}.
|
|
18893
|
+
* This may be useful when, for instance, nesting ngRepeats.
|
|
18930
18894
|
*
|
|
18931
18895
|
* # Special repeat start and end points
|
|
18932
18896
|
* To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending
|
|
@@ -19809,11 +19773,9 @@ var ngSwitchWhenDirective = ngDirective({
|
|
|
19809
19773
|
transclude: 'element',
|
|
19810
19774
|
priority: 800,
|
|
19811
19775
|
require: '^ngSwitch',
|
|
19812
|
-
|
|
19813
|
-
|
|
19814
|
-
|
|
19815
|
-
ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });
|
|
19816
|
-
};
|
|
19776
|
+
link: function(scope, element, attrs, ctrl, $transclude) {
|
|
19777
|
+
ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);
|
|
19778
|
+
ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });
|
|
19817
19779
|
}
|
|
19818
19780
|
});
|
|
19819
19781
|
|
|
@@ -19908,10 +19870,14 @@ var ngTranscludeDirective = ngDirective({
|
|
|
19908
19870
|
* @restrict E
|
|
19909
19871
|
*
|
|
19910
19872
|
* @description
|
|
19911
|
-
* Load content of a script
|
|
19912
|
-
* template can be used by
|
|
19873
|
+
* Load the content of a `<script>` element into {@link api/ng.$templateCache `$templateCache`}, so that the
|
|
19874
|
+
* template can be used by {@link api/ng.directive:ngInclude `ngInclude`},
|
|
19875
|
+
* {@link api/ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the
|
|
19876
|
+
* `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be
|
|
19877
|
+
* assigned through the element's `id`, which can then be used as a directive's `templateUrl`.
|
|
19913
19878
|
*
|
|
19914
|
-
* @param {'text/ng-template'} type
|
|
19879
|
+
* @param {'text/ng-template'} type Must be set to `'text/ng-template'`.
|
|
19880
|
+
* @param {string} id Cache name of the template.
|
|
19915
19881
|
*
|
|
19916
19882
|
* @example
|
|
19917
19883
|
<doc:example>
|
|
@@ -20075,8 +20041,8 @@ var ngOptionsMinErr = minErr('ngOptions');
|
|
|
20075
20041
|
var ngOptionsDirective = valueFn({ terminal: true });
|
|
20076
20042
|
// jshint maxlen: false
|
|
20077
20043
|
var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|
20078
|
-
//
|
|
20079
|
-
var NG_OPTIONS_REGEXP = /^\s*(
|
|
20044
|
+
//000011111111110000000000022222222220000000000000000000003333333333000000000000004444444444444440000000005555555555555550000000666666666666666000000000000000777777777700000000000000000008888888888
|
|
20045
|
+
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]+?))?$/,
|
|
20080
20046
|
nullModelCtrl = {$setViewValue: noop};
|
|
20081
20047
|
// jshint maxlen: 100
|
|
20082
20048
|
|