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
|
*/
|
|
@@ -69,7 +69,7 @@ function minErr(module) {
|
|
|
69
69
|
return match;
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
message = message + '\nhttp://errors.angularjs.org/1.2.
|
|
72
|
+
message = message + '\nhttp://errors.angularjs.org/1.2.8/' +
|
|
73
73
|
(module ? module + '/' : '') + code;
|
|
74
74
|
for (i = 2; i < arguments.length; i++) {
|
|
75
75
|
message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
|
|
@@ -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
|
*/
|
|
@@ -2086,6 +2086,20 @@ if(window.jasmine || window.mocha) {
|
|
|
2086
2086
|
*
|
|
2087
2087
|
* @param {...Function} fns any number of functions which will be injected using the injector.
|
|
2088
2088
|
*/
|
|
2089
|
+
|
|
2090
|
+
|
|
2091
|
+
|
|
2092
|
+
var ErrorAddingDeclarationLocationStack = function(e, errorForStack) {
|
|
2093
|
+
this.message = e.message;
|
|
2094
|
+
this.name = e.name;
|
|
2095
|
+
if (e.line) this.line = e.line;
|
|
2096
|
+
if (e.sourceId) this.sourceId = e.sourceId;
|
|
2097
|
+
if (e.stack && errorForStack)
|
|
2098
|
+
this.stack = e.stack + '\n' + errorForStack.stack;
|
|
2099
|
+
if (e.stackArray) this.stackArray = e.stackArray;
|
|
2100
|
+
};
|
|
2101
|
+
ErrorAddingDeclarationLocationStack.prototype.toString = Error.prototype.toString;
|
|
2102
|
+
|
|
2089
2103
|
window.inject = angular.mock.inject = function() {
|
|
2090
2104
|
var blockFns = Array.prototype.slice.call(arguments, 0);
|
|
2091
2105
|
var errorForStack = new Error('Declaration Location');
|
|
@@ -2106,7 +2120,9 @@ if(window.jasmine || window.mocha) {
|
|
|
2106
2120
|
injector.invoke(blockFns[i] || angular.noop, this);
|
|
2107
2121
|
/* jshint +W040 */
|
|
2108
2122
|
} catch (e) {
|
|
2109
|
-
if(e.stack && errorForStack)
|
|
2123
|
+
if (e.stack && errorForStack) {
|
|
2124
|
+
throw new ErrorAddingDeclarationLocationStack(e, errorForStack);
|
|
2125
|
+
}
|
|
2110
2126
|
throw e;
|
|
2111
2127
|
} finally {
|
|
2112
2128
|
errorForStack = null;
|
|
@@ -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
|
*/
|
|
@@ -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
|
|
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`.
|
|
@@ -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.
|
|
9793
|
+
* @license AngularJS v1.2.8
|
|
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.
|
|
9863
|
+
message = message + '\nhttp://errors.angularjs.org/1.2.8/' +
|
|
9864
9864
|
(module ? module + '/' : '') + code;
|
|
9865
9865
|
for (i = 2; i < arguments.length; i++) {
|
|
9866
9866
|
message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
|
|
@@ -11625,11 +11625,11 @@ function setupModuleLoader(window) {
|
|
|
11625
11625
|
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
|
|
11626
11626
|
*/
|
|
11627
11627
|
var version = {
|
|
11628
|
-
full: '1.2.
|
|
11628
|
+
full: '1.2.8', // all of these placeholder strings will be replaced by grunt's
|
|
11629
11629
|
major: 1, // package task
|
|
11630
11630
|
minor: 2,
|
|
11631
|
-
dot:
|
|
11632
|
-
codeName: '
|
|
11631
|
+
dot: 8,
|
|
11632
|
+
codeName: 'interdimensional-cartography'
|
|
11633
11633
|
};
|
|
11634
11634
|
|
|
11635
11635
|
|
|
@@ -16440,7 +16440,7 @@ function directiveNormalize(name) {
|
|
|
16440
16440
|
*
|
|
16441
16441
|
*
|
|
16442
16442
|
* @param {string} name Normalized element attribute name of the property to modify. The name is
|
|
16443
|
-
*
|
|
16443
|
+
* reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}
|
|
16444
16444
|
* property to the original name.
|
|
16445
16445
|
* @param {string} value Value to set the attribute to. The value can be an interpolated string.
|
|
16446
16446
|
*/
|
|
@@ -16578,8 +16578,7 @@ function $ControllerProvider() {
|
|
|
16578
16578
|
* @requires $window
|
|
16579
16579
|
*
|
|
16580
16580
|
* @description
|
|
16581
|
-
* A {@link angular.element jQuery
|
|
16582
|
-
* element.
|
|
16581
|
+
* A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.
|
|
16583
16582
|
*/
|
|
16584
16583
|
function $DocumentProvider(){
|
|
16585
16584
|
this.$get = ['$window', function(window){
|
|
@@ -16918,7 +16917,15 @@ function $HttpProvider() {
|
|
|
16918
16917
|
* `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }.
|
|
16919
16918
|
*
|
|
16920
16919
|
* The defaults can also be set at runtime via the `$http.defaults` object in the same
|
|
16921
|
-
* fashion.
|
|
16920
|
+
* fashion. For example:
|
|
16921
|
+
*
|
|
16922
|
+
* ```
|
|
16923
|
+
* module.run(function($http) {
|
|
16924
|
+
* $http.defaults.headers.common.Authentication = 'Basic YmVlcDpib29w'
|
|
16925
|
+
* });
|
|
16926
|
+
* ```
|
|
16927
|
+
*
|
|
16928
|
+
* In addition, you can supply a `headers` property in the config object passed when
|
|
16922
16929
|
* calling `$http(config)`, which overrides the defaults without changing them globally.
|
|
16923
16930
|
*
|
|
16924
16931
|
*
|
|
@@ -16942,7 +16949,9 @@ function $HttpProvider() {
|
|
|
16942
16949
|
* properties. These properties are by default an array of transform functions, which allows you
|
|
16943
16950
|
* to `push` or `unshift` a new transformation function into the transformation chain. You can
|
|
16944
16951
|
* also decide to completely override any default transformations by assigning your
|
|
16945
|
-
* transformation functions to these properties directly without the array wrapper.
|
|
16952
|
+
* transformation functions to these properties directly without the array wrapper. These defaults
|
|
16953
|
+
* are again available on the $http factory at run-time, which may be useful if you have run-time
|
|
16954
|
+
* services you wish to be involved in your transformations.
|
|
16946
16955
|
*
|
|
16947
16956
|
* Similarly, to locally override the request/response transforms, augment the
|
|
16948
16957
|
* `transformRequest` and/or `transformResponse` properties of the configuration object passed
|
|
@@ -17156,7 +17165,8 @@ function $HttpProvider() {
|
|
|
17156
17165
|
* for added security.
|
|
17157
17166
|
*
|
|
17158
17167
|
* The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
|
|
17159
|
-
* properties of either $httpProvider.defaults,
|
|
17168
|
+
* properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,
|
|
17169
|
+
* or the per-request config object.
|
|
17160
17170
|
*
|
|
17161
17171
|
*
|
|
17162
17172
|
* @param {object} config Object describing the request to be made and how it should be
|
|
@@ -17719,7 +17729,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
|
|
17719
17729
|
} else {
|
|
17720
17730
|
completeRequest(callback, status || -2);
|
|
17721
17731
|
}
|
|
17722
|
-
|
|
17732
|
+
callbacks[callbackId] = angular.noop;
|
|
17723
17733
|
});
|
|
17724
17734
|
} else {
|
|
17725
17735
|
|
|
@@ -17736,7 +17746,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
|
|
17736
17746
|
// response is in the cache. the promise api will ensure that to the app code the api is
|
|
17737
17747
|
// always async
|
|
17738
17748
|
xhr.onreadystatechange = function() {
|
|
17739
|
-
// onreadystatechange might
|
|
17749
|
+
// onreadystatechange might get called multiple times with readyState === 4 on mobile webkit caused by
|
|
17740
17750
|
// xhrs that are resolved while the app is in the background (see #5426).
|
|
17741
17751
|
// since calling completeRequest sets the `xhr` variable to null, we just check if it's not null before
|
|
17742
17752
|
// continuing
|
|
@@ -17749,11 +17759,12 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
|
|
17749
17759
|
|
|
17750
17760
|
if(status !== ABORTED) {
|
|
17751
17761
|
responseHeaders = xhr.getAllResponseHeaders();
|
|
17752
|
-
|
|
17762
|
+
|
|
17763
|
+
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
|
|
17764
|
+
// response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
|
|
17765
|
+
response = ('response' in xhr) ? xhr.response : xhr.responseText;
|
|
17753
17766
|
}
|
|
17754
17767
|
|
|
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
17768
|
completeRequest(callback,
|
|
17758
17769
|
status || xhr.status,
|
|
17759
17770
|
response,
|
|
@@ -17786,14 +17797,14 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
|
|
17786
17797
|
}
|
|
17787
17798
|
|
|
17788
17799
|
function completeRequest(callback, status, response, headersString) {
|
|
17789
|
-
var protocol = urlResolve(url).protocol;
|
|
17790
|
-
|
|
17791
17800
|
// cancel timeout and subsequent timeout promise resolution
|
|
17792
17801
|
timeoutId && $browserDefer.cancel(timeoutId);
|
|
17793
17802
|
jsonpDone = xhr = null;
|
|
17794
17803
|
|
|
17795
|
-
// fix status code
|
|
17796
|
-
|
|
17804
|
+
// fix status code when it is 0 (0 status is undocumented).
|
|
17805
|
+
// Occurs when accessing file resources.
|
|
17806
|
+
// On Android 4.1 stock browser it occurs while retrieving files from application cache.
|
|
17807
|
+
status = (status === 0) ? (response ? 200 : 404) : status;
|
|
17797
17808
|
|
|
17798
17809
|
// normalize IE bug (http://bugs.jquery.com/ticket/1450)
|
|
17799
17810
|
status = status == 1223 ? 204 : status;
|
|
@@ -18907,7 +18918,7 @@ function $LocationProvider(){
|
|
|
18907
18918
|
* Broadcasted before a URL will change. This change can be prevented by calling
|
|
18908
18919
|
* `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
|
|
18909
18920
|
* details about event object. Upon successful change
|
|
18910
|
-
* {@link ng.$location
|
|
18921
|
+
* {@link ng.$location#events_$locationChangeSuccess $locationChangeSuccess} is fired.
|
|
18911
18922
|
*
|
|
18912
18923
|
* @param {Object} angularEvent Synthetic event object.
|
|
18913
18924
|
* @param {string} newUrl New URL
|
|
@@ -20098,16 +20109,20 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
|
|
|
20098
20109
|
if (pathVal == null) return pathVal;
|
|
20099
20110
|
pathVal = pathVal[key0];
|
|
20100
20111
|
|
|
20101
|
-
if (
|
|
20112
|
+
if (!key1) return pathVal;
|
|
20113
|
+
if (pathVal == null) return undefined;
|
|
20102
20114
|
pathVal = pathVal[key1];
|
|
20103
20115
|
|
|
20104
|
-
if (
|
|
20116
|
+
if (!key2) return pathVal;
|
|
20117
|
+
if (pathVal == null) return undefined;
|
|
20105
20118
|
pathVal = pathVal[key2];
|
|
20106
20119
|
|
|
20107
|
-
if (
|
|
20120
|
+
if (!key3) return pathVal;
|
|
20121
|
+
if (pathVal == null) return undefined;
|
|
20108
20122
|
pathVal = pathVal[key3];
|
|
20109
20123
|
|
|
20110
|
-
if (
|
|
20124
|
+
if (!key4) return pathVal;
|
|
20125
|
+
if (pathVal == null) return undefined;
|
|
20111
20126
|
pathVal = pathVal[key4];
|
|
20112
20127
|
|
|
20113
20128
|
return pathVal;
|
|
@@ -20128,8 +20143,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
|
|
|
20128
20143
|
}
|
|
20129
20144
|
pathVal = pathVal.$$v;
|
|
20130
20145
|
}
|
|
20131
|
-
if (pathVal == null) return key1 ? undefined : pathVal;
|
|
20132
20146
|
|
|
20147
|
+
if (!key1) return pathVal;
|
|
20148
|
+
if (pathVal == null) return undefined;
|
|
20133
20149
|
pathVal = pathVal[key1];
|
|
20134
20150
|
if (pathVal && pathVal.then) {
|
|
20135
20151
|
promiseWarning(fullExp);
|
|
@@ -20140,8 +20156,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
|
|
|
20140
20156
|
}
|
|
20141
20157
|
pathVal = pathVal.$$v;
|
|
20142
20158
|
}
|
|
20143
|
-
if (pathVal == null) return key2 ? undefined : pathVal;
|
|
20144
20159
|
|
|
20160
|
+
if (!key2) return pathVal;
|
|
20161
|
+
if (pathVal == null) return undefined;
|
|
20145
20162
|
pathVal = pathVal[key2];
|
|
20146
20163
|
if (pathVal && pathVal.then) {
|
|
20147
20164
|
promiseWarning(fullExp);
|
|
@@ -20152,8 +20169,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
|
|
|
20152
20169
|
}
|
|
20153
20170
|
pathVal = pathVal.$$v;
|
|
20154
20171
|
}
|
|
20155
|
-
if (pathVal == null) return key3 ? undefined : pathVal;
|
|
20156
20172
|
|
|
20173
|
+
if (!key3) return pathVal;
|
|
20174
|
+
if (pathVal == null) return undefined;
|
|
20157
20175
|
pathVal = pathVal[key3];
|
|
20158
20176
|
if (pathVal && pathVal.then) {
|
|
20159
20177
|
promiseWarning(fullExp);
|
|
@@ -20164,8 +20182,9 @@ function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
|
|
|
20164
20182
|
}
|
|
20165
20183
|
pathVal = pathVal.$$v;
|
|
20166
20184
|
}
|
|
20167
|
-
if (pathVal == null) return key4 ? undefined : pathVal;
|
|
20168
20185
|
|
|
20186
|
+
if (!key4) return pathVal;
|
|
20187
|
+
if (pathVal == null) return undefined;
|
|
20169
20188
|
pathVal = pathVal[key4];
|
|
20170
20189
|
if (pathVal && pathVal.then) {
|
|
20171
20190
|
promiseWarning(fullExp);
|
|
@@ -21163,7 +21182,7 @@ function $RootScopeProvider(){
|
|
|
21163
21182
|
} else {
|
|
21164
21183
|
ChildScope = function() {}; // should be anonymous; This is so that when the minifier munges
|
|
21165
21184
|
// the name it does not become random set of chars. This will then show up as class
|
|
21166
|
-
// name in the
|
|
21185
|
+
// name in the web inspector.
|
|
21167
21186
|
ChildScope.prototype = this;
|
|
21168
21187
|
child = new ChildScope();
|
|
21169
21188
|
child.$id = nextUid();
|
|
@@ -21264,7 +21283,7 @@ function $RootScopeProvider(){
|
|
|
21264
21283
|
// No digest has been run so the counter will be zero
|
|
21265
21284
|
expect(scope.foodCounter).toEqual(0);
|
|
21266
21285
|
|
|
21267
|
-
// Run the digest but since food has not changed
|
|
21286
|
+
// Run the digest but since food has not changed count will still be zero
|
|
21268
21287
|
scope.$digest();
|
|
21269
21288
|
expect(scope.foodCounter).toEqual(0);
|
|
21270
21289
|
|
|
@@ -23687,8 +23706,8 @@ function $FilterProvider($provide) {
|
|
|
23687
23706
|
*
|
|
23688
23707
|
* Can be one of:
|
|
23689
23708
|
*
|
|
23690
|
-
* - `string`:
|
|
23691
|
-
*
|
|
23709
|
+
* - `string`: The string is evaluated as an expression and the resulting value is used for substring match against
|
|
23710
|
+
* the contents of the `array`. All strings or objects with string properties in `array` that contain this string
|
|
23692
23711
|
* will be returned. The predicate can be negated by prefixing the string with `!`.
|
|
23693
23712
|
*
|
|
23694
23713
|
* - `Object`: A pattern object can be used to filter specific properties on objects contained
|
|
@@ -23846,23 +23865,12 @@ function filterFilter() {
|
|
|
23846
23865
|
case "object":
|
|
23847
23866
|
// jshint +W086
|
|
23848
23867
|
for (var key in expression) {
|
|
23849
|
-
|
|
23850
|
-
(
|
|
23851
|
-
|
|
23852
|
-
|
|
23853
|
-
|
|
23854
|
-
|
|
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
|
-
}
|
|
23868
|
+
(function(path) {
|
|
23869
|
+
if (typeof expression[path] == 'undefined') return;
|
|
23870
|
+
predicates.push(function(value) {
|
|
23871
|
+
return search(path == '$' ? value : getter(value, path), expression[path]);
|
|
23872
|
+
});
|
|
23873
|
+
})(key);
|
|
23866
23874
|
}
|
|
23867
23875
|
break;
|
|
23868
23876
|
case 'function':
|
|
@@ -24983,12 +24991,10 @@ forEach(BOOLEAN_ATTR, function(propName, attrName) {
|
|
|
24983
24991
|
ngAttributeAliasDirectives[normalized] = function() {
|
|
24984
24992
|
return {
|
|
24985
24993
|
priority: 100,
|
|
24986
|
-
|
|
24987
|
-
|
|
24988
|
-
|
|
24989
|
-
|
|
24990
|
-
});
|
|
24991
|
-
};
|
|
24994
|
+
link: function(scope, element, attr) {
|
|
24995
|
+
scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
|
|
24996
|
+
attr.$set(attrName, !!value);
|
|
24997
|
+
});
|
|
24992
24998
|
}
|
|
24993
24999
|
};
|
|
24994
25000
|
};
|
|
@@ -25268,10 +25274,10 @@ function FormController(element, attrs) {
|
|
|
25268
25274
|
*
|
|
25269
25275
|
*
|
|
25270
25276
|
* # CSS classes
|
|
25271
|
-
* - `ng-valid`
|
|
25272
|
-
* - `ng-invalid`
|
|
25273
|
-
* - `ng-pristine`
|
|
25274
|
-
* - `ng-dirty`
|
|
25277
|
+
* - `ng-valid` is set if the form is valid.
|
|
25278
|
+
* - `ng-invalid` is set if the form is invalid.
|
|
25279
|
+
* - `ng-pristine` is set if the form is pristine.
|
|
25280
|
+
* - `ng-dirty` is set if the form is dirty.
|
|
25275
25281
|
*
|
|
25276
25282
|
*
|
|
25277
25283
|
* # Submitting a form and preventing the default action
|
|
@@ -25788,6 +25794,12 @@ var inputType = {
|
|
|
25788
25794
|
'reset': noop
|
|
25789
25795
|
};
|
|
25790
25796
|
|
|
25797
|
+
// A helper function to call $setValidity and return the value / undefined,
|
|
25798
|
+
// a pattern that is repeated a lot in the input validation logic.
|
|
25799
|
+
function validate(ctrl, validatorName, validity, value){
|
|
25800
|
+
ctrl.$setValidity(validatorName, validity);
|
|
25801
|
+
return validity ? value : undefined;
|
|
25802
|
+
}
|
|
25791
25803
|
|
|
25792
25804
|
function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
25793
25805
|
// In composition mode, users are still inputing intermediate text buffer,
|
|
@@ -25872,22 +25884,15 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
25872
25884
|
patternValidator,
|
|
25873
25885
|
match;
|
|
25874
25886
|
|
|
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
25887
|
if (pattern) {
|
|
25888
|
+
var validateRegex = function(regexp, value) {
|
|
25889
|
+
return validate(ctrl, 'pattern', ctrl.$isEmpty(value) || regexp.test(value), value);
|
|
25890
|
+
};
|
|
25886
25891
|
match = pattern.match(/^\/(.*)\/([gim]*)$/);
|
|
25887
25892
|
if (match) {
|
|
25888
25893
|
pattern = new RegExp(match[1], match[2]);
|
|
25889
25894
|
patternValidator = function(value) {
|
|
25890
|
-
return
|
|
25895
|
+
return validateRegex(pattern, value);
|
|
25891
25896
|
};
|
|
25892
25897
|
} else {
|
|
25893
25898
|
patternValidator = function(value) {
|
|
@@ -25898,7 +25903,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
25898
25903
|
'Expected {0} to be a RegExp but was {1}. Element: {2}', pattern,
|
|
25899
25904
|
patternObj, startingTag(element));
|
|
25900
25905
|
}
|
|
25901
|
-
return
|
|
25906
|
+
return validateRegex(patternObj, value);
|
|
25902
25907
|
};
|
|
25903
25908
|
}
|
|
25904
25909
|
|
|
@@ -25910,13 +25915,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
25910
25915
|
if (attr.ngMinlength) {
|
|
25911
25916
|
var minlength = int(attr.ngMinlength);
|
|
25912
25917
|
var minLengthValidator = function(value) {
|
|
25913
|
-
|
|
25914
|
-
ctrl.$setValidity('minlength', false);
|
|
25915
|
-
return undefined;
|
|
25916
|
-
} else {
|
|
25917
|
-
ctrl.$setValidity('minlength', true);
|
|
25918
|
-
return value;
|
|
25919
|
-
}
|
|
25918
|
+
return validate(ctrl, 'minlength', ctrl.$isEmpty(value) || value.length >= minlength, value);
|
|
25920
25919
|
};
|
|
25921
25920
|
|
|
25922
25921
|
ctrl.$parsers.push(minLengthValidator);
|
|
@@ -25927,13 +25926,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
25927
25926
|
if (attr.ngMaxlength) {
|
|
25928
25927
|
var maxlength = int(attr.ngMaxlength);
|
|
25929
25928
|
var maxLengthValidator = function(value) {
|
|
25930
|
-
|
|
25931
|
-
ctrl.$setValidity('maxlength', false);
|
|
25932
|
-
return undefined;
|
|
25933
|
-
} else {
|
|
25934
|
-
ctrl.$setValidity('maxlength', true);
|
|
25935
|
-
return value;
|
|
25936
|
-
}
|
|
25929
|
+
return validate(ctrl, 'maxlength', ctrl.$isEmpty(value) || value.length <= maxlength, value);
|
|
25937
25930
|
};
|
|
25938
25931
|
|
|
25939
25932
|
ctrl.$parsers.push(maxLengthValidator);
|
|
@@ -25962,13 +25955,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
25962
25955
|
if (attr.min) {
|
|
25963
25956
|
var minValidator = function(value) {
|
|
25964
25957
|
var min = parseFloat(attr.min);
|
|
25965
|
-
|
|
25966
|
-
ctrl.$setValidity('min', false);
|
|
25967
|
-
return undefined;
|
|
25968
|
-
} else {
|
|
25969
|
-
ctrl.$setValidity('min', true);
|
|
25970
|
-
return value;
|
|
25971
|
-
}
|
|
25958
|
+
return validate(ctrl, 'min', ctrl.$isEmpty(value) || value >= min, value);
|
|
25972
25959
|
};
|
|
25973
25960
|
|
|
25974
25961
|
ctrl.$parsers.push(minValidator);
|
|
@@ -25978,13 +25965,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
25978
25965
|
if (attr.max) {
|
|
25979
25966
|
var maxValidator = function(value) {
|
|
25980
25967
|
var max = parseFloat(attr.max);
|
|
25981
|
-
|
|
25982
|
-
ctrl.$setValidity('max', false);
|
|
25983
|
-
return undefined;
|
|
25984
|
-
} else {
|
|
25985
|
-
ctrl.$setValidity('max', true);
|
|
25986
|
-
return value;
|
|
25987
|
-
}
|
|
25968
|
+
return validate(ctrl, 'max', ctrl.$isEmpty(value) || value <= max, value);
|
|
25988
25969
|
};
|
|
25989
25970
|
|
|
25990
25971
|
ctrl.$parsers.push(maxValidator);
|
|
@@ -25992,14 +25973,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
25992
25973
|
}
|
|
25993
25974
|
|
|
25994
25975
|
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
|
-
}
|
|
25976
|
+
return validate(ctrl, 'number', ctrl.$isEmpty(value) || isNumber(value), value);
|
|
26003
25977
|
});
|
|
26004
25978
|
}
|
|
26005
25979
|
|
|
@@ -26007,13 +25981,7 @@ function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
26007
25981
|
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
|
|
26008
25982
|
|
|
26009
25983
|
var urlValidator = function(value) {
|
|
26010
|
-
|
|
26011
|
-
ctrl.$setValidity('url', true);
|
|
26012
|
-
return value;
|
|
26013
|
-
} else {
|
|
26014
|
-
ctrl.$setValidity('url', false);
|
|
26015
|
-
return undefined;
|
|
26016
|
-
}
|
|
25984
|
+
return validate(ctrl, 'url', ctrl.$isEmpty(value) || URL_REGEXP.test(value), value);
|
|
26017
25985
|
};
|
|
26018
25986
|
|
|
26019
25987
|
ctrl.$formatters.push(urlValidator);
|
|
@@ -26024,13 +25992,7 @@ function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|
|
26024
25992
|
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
|
|
26025
25993
|
|
|
26026
25994
|
var emailValidator = function(value) {
|
|
26027
|
-
|
|
26028
|
-
ctrl.$setValidity('email', true);
|
|
26029
|
-
return value;
|
|
26030
|
-
} else {
|
|
26031
|
-
ctrl.$setValidity('email', false);
|
|
26032
|
-
return undefined;
|
|
26033
|
-
}
|
|
25995
|
+
return validate(ctrl, 'email', ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value), value);
|
|
26034
25996
|
};
|
|
26035
25997
|
|
|
26036
25998
|
ctrl.$formatters.push(emailValidator);
|
|
@@ -27634,13 +27596,13 @@ var ngControllerDirective = [function() {
|
|
|
27634
27596
|
</button>
|
|
27635
27597
|
count: {{count}}
|
|
27636
27598
|
</doc:source>
|
|
27637
|
-
<doc:
|
|
27599
|
+
<doc:protractor>
|
|
27638
27600
|
it('should check ng-click', function() {
|
|
27639
|
-
expect(binding('count')).
|
|
27640
|
-
element('.doc-example-live
|
|
27641
|
-
expect(binding('count')).
|
|
27601
|
+
expect(element(by.binding('count')).getText()).toMatch('0');
|
|
27602
|
+
element(by.css('.doc-example-live button')).click();
|
|
27603
|
+
expect(element(by.binding('count')).getText()).toMatch('1');
|
|
27642
27604
|
});
|
|
27643
|
-
</doc:
|
|
27605
|
+
</doc:protractor>
|
|
27644
27606
|
</doc:example>
|
|
27645
27607
|
*/
|
|
27646
27608
|
/*
|
|
@@ -28719,6 +28681,8 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp
|
|
|
28719
28681
|
* | `$even` | {@type boolean} | true if the iterator position `$index` is even (otherwise false). |
|
|
28720
28682
|
* | `$odd` | {@type boolean} | true if the iterator position `$index` is odd (otherwise false). |
|
|
28721
28683
|
*
|
|
28684
|
+
* Creating aliases for these properties is possible with {@link api/ng.directive:ngInit `ngInit`}.
|
|
28685
|
+
* This may be useful when, for instance, nesting ngRepeats.
|
|
28722
28686
|
*
|
|
28723
28687
|
* # Special repeat start and end points
|
|
28724
28688
|
* To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending
|
|
@@ -29601,11 +29565,9 @@ var ngSwitchWhenDirective = ngDirective({
|
|
|
29601
29565
|
transclude: 'element',
|
|
29602
29566
|
priority: 800,
|
|
29603
29567
|
require: '^ngSwitch',
|
|
29604
|
-
|
|
29605
|
-
|
|
29606
|
-
|
|
29607
|
-
ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });
|
|
29608
|
-
};
|
|
29568
|
+
link: function(scope, element, attrs, ctrl, $transclude) {
|
|
29569
|
+
ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);
|
|
29570
|
+
ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });
|
|
29609
29571
|
}
|
|
29610
29572
|
});
|
|
29611
29573
|
|
|
@@ -29700,10 +29662,14 @@ var ngTranscludeDirective = ngDirective({
|
|
|
29700
29662
|
* @restrict E
|
|
29701
29663
|
*
|
|
29702
29664
|
* @description
|
|
29703
|
-
* Load content of a script
|
|
29704
|
-
* template can be used by
|
|
29665
|
+
* Load the content of a `<script>` element into {@link api/ng.$templateCache `$templateCache`}, so that the
|
|
29666
|
+
* template can be used by {@link api/ng.directive:ngInclude `ngInclude`},
|
|
29667
|
+
* {@link api/ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the
|
|
29668
|
+
* `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be
|
|
29669
|
+
* assigned through the element's `id`, which can then be used as a directive's `templateUrl`.
|
|
29705
29670
|
*
|
|
29706
|
-
* @param {'text/ng-template'} type
|
|
29671
|
+
* @param {'text/ng-template'} type Must be set to `'text/ng-template'`.
|
|
29672
|
+
* @param {string} id Cache name of the template.
|
|
29707
29673
|
*
|
|
29708
29674
|
* @example
|
|
29709
29675
|
<doc:example>
|
|
@@ -29867,8 +29833,8 @@ var ngOptionsMinErr = minErr('ngOptions');
|
|
|
29867
29833
|
var ngOptionsDirective = valueFn({ terminal: true });
|
|
29868
29834
|
// jshint maxlen: false
|
|
29869
29835
|
var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|
29870
|
-
//
|
|
29871
|
-
var NG_OPTIONS_REGEXP = /^\s*(
|
|
29836
|
+
//000011111111110000000000022222222220000000000000000000003333333333000000000000004444444444444440000000005555555555555550000000666666666666666000000000000000777777777700000000000000000008888888888
|
|
29837
|
+
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
29838
|
nullModelCtrl = {$setViewValue: noop};
|
|
29873
29839
|
// jshint maxlen: 100
|
|
29874
29840
|
|