angularjs-rails 1.3.2 → 1.3.3
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.
- checksums.yaml +4 -4
- data/lib/angularjs-rails/version.rb +2 -2
- data/vendor/assets/javascripts/angular-animate.js +2 -2
- data/vendor/assets/javascripts/angular-aria.js +83 -23
- data/vendor/assets/javascripts/angular-cookies.js +1 -1
- data/vendor/assets/javascripts/angular-loader.js +6 -23
- data/vendor/assets/javascripts/angular-messages.js +1 -1
- data/vendor/assets/javascripts/angular-mocks.js +21 -17
- data/vendor/assets/javascripts/angular-resource.js +1 -1
- data/vendor/assets/javascripts/angular-route.js +19 -5
- data/vendor/assets/javascripts/angular-sanitize.js +20 -20
- data/vendor/assets/javascripts/angular-scenario.js +298 -269
- data/vendor/assets/javascripts/angular-touch.js +3 -3
- data/vendor/assets/javascripts/angular.js +292 -263
- data/vendor/assets/javascripts/unstable/angular-animate.js +2 -2
- data/vendor/assets/javascripts/unstable/angular-aria.js +83 -23
- data/vendor/assets/javascripts/unstable/angular-cookies.js +1 -1
- data/vendor/assets/javascripts/unstable/angular-loader.js +6 -23
- data/vendor/assets/javascripts/unstable/angular-messages.js +1 -1
- data/vendor/assets/javascripts/unstable/angular-mocks.js +21 -17
- data/vendor/assets/javascripts/unstable/angular-resource.js +1 -1
- data/vendor/assets/javascripts/unstable/angular-route.js +19 -5
- data/vendor/assets/javascripts/unstable/angular-sanitize.js +20 -20
- data/vendor/assets/javascripts/unstable/angular-scenario.js +298 -269
- data/vendor/assets/javascripts/unstable/angular-touch.js +3 -3
- data/vendor/assets/javascripts/unstable/angular.js +292 -263
- metadata +2 -2
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.3.
|
2
|
+
* @license AngularJS v1.3.3
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -301,7 +301,7 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
|
|
301
301
|
// Splices out the allowable region from the list after it has been used.
|
302
302
|
function checkAllowableRegions(touchCoordinates, x, y) {
|
303
303
|
for (var i = 0; i < touchCoordinates.length; i += 2) {
|
304
|
-
if (hit(touchCoordinates[i], touchCoordinates[i+1], x, y)) {
|
304
|
+
if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {
|
305
305
|
touchCoordinates.splice(i, i + 2);
|
306
306
|
return true; // allowable region
|
307
307
|
}
|
@@ -366,7 +366,7 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
|
|
366
366
|
$timeout(function() {
|
367
367
|
// Remove the allowable region.
|
368
368
|
for (var i = 0; i < touchCoordinates.length; i += 2) {
|
369
|
-
if (touchCoordinates[i] == x && touchCoordinates[i+1] == y) {
|
369
|
+
if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) {
|
370
370
|
touchCoordinates.splice(i, i + 2);
|
371
371
|
return;
|
372
372
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.3.
|
2
|
+
* @license AngularJS v1.3.3
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -42,40 +42,23 @@ function minErr(module, ErrorConstructor) {
|
|
42
42
|
prefix = '[' + (module ? module + ':' : '') + code + '] ',
|
43
43
|
template = arguments[1],
|
44
44
|
templateArgs = arguments,
|
45
|
-
|
46
|
-
if (typeof obj === 'function') {
|
47
|
-
return obj.toString().replace(/ \{[\s\S]*$/, '');
|
48
|
-
} else if (typeof obj === 'undefined') {
|
49
|
-
return 'undefined';
|
50
|
-
} else if (typeof obj !== 'string') {
|
51
|
-
return JSON.stringify(obj);
|
52
|
-
}
|
53
|
-
return obj;
|
54
|
-
},
|
45
|
+
|
55
46
|
message, i;
|
56
47
|
|
57
48
|
message = prefix + template.replace(/\{\d+\}/g, function(match) {
|
58
49
|
var index = +match.slice(1, -1), arg;
|
59
50
|
|
60
51
|
if (index + 2 < templateArgs.length) {
|
61
|
-
|
62
|
-
if (typeof arg === 'function') {
|
63
|
-
return arg.toString().replace(/ ?\{[\s\S]*$/, '');
|
64
|
-
} else if (typeof arg === 'undefined') {
|
65
|
-
return 'undefined';
|
66
|
-
} else if (typeof arg !== 'string') {
|
67
|
-
return toJson(arg);
|
68
|
-
}
|
69
|
-
return arg;
|
52
|
+
return toDebugString(templateArgs[index + 2]);
|
70
53
|
}
|
71
54
|
return match;
|
72
55
|
});
|
73
56
|
|
74
|
-
message = message + '\nhttp://errors.angularjs.org/1.3.
|
57
|
+
message = message + '\nhttp://errors.angularjs.org/1.3.3/' +
|
75
58
|
(module ? module + '/' : '') + code;
|
76
59
|
for (i = 2; i < arguments.length; i++) {
|
77
|
-
message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
|
78
|
-
encodeURIComponent(
|
60
|
+
message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
|
61
|
+
encodeURIComponent(toDebugString(arguments[i]));
|
79
62
|
}
|
80
63
|
return new ErrorConstructor(message);
|
81
64
|
};
|
@@ -715,7 +698,7 @@ function includes(array, obj) {
|
|
715
698
|
|
716
699
|
function arrayRemove(array, value) {
|
717
700
|
var index = array.indexOf(value);
|
718
|
-
if (index >=0)
|
701
|
+
if (index >= 0)
|
719
702
|
array.splice(index, 1);
|
720
703
|
return value;
|
721
704
|
}
|
@@ -916,7 +899,7 @@ function equals(o1, o2) {
|
|
916
899
|
if (isArray(o1)) {
|
917
900
|
if (!isArray(o2)) return false;
|
918
901
|
if ((length = o1.length) == o2.length) {
|
919
|
-
for (key=0; key<length; key++) {
|
902
|
+
for (key = 0; key < length; key++) {
|
920
903
|
if (!equals(o1[key], o2[key])) return false;
|
921
904
|
}
|
922
905
|
return true;
|
@@ -1002,7 +985,7 @@ function bind(self, fn) {
|
|
1002
985
|
return curryArgs.length
|
1003
986
|
? function() {
|
1004
987
|
return arguments.length
|
1005
|
-
? fn.apply(self,
|
988
|
+
? fn.apply(self, concat(curryArgs, arguments, 0))
|
1006
989
|
: fn.apply(self, curryArgs);
|
1007
990
|
}
|
1008
991
|
: function() {
|
@@ -1202,7 +1185,7 @@ var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
|
|
1202
1185
|
function getNgAttribute(element, ngAttr) {
|
1203
1186
|
var attr, i, ii = ngAttrPrefixes.length;
|
1204
1187
|
element = jqLite(element);
|
1205
|
-
for (i=0; i<ii; ++i) {
|
1188
|
+
for (i = 0; i < ii; ++i) {
|
1206
1189
|
attr = ngAttrPrefixes[i] + ngAttr;
|
1207
1190
|
if (isString(attr = element.attr(attr))) {
|
1208
1191
|
return attr;
|
@@ -1987,6 +1970,34 @@ function setupModuleLoader(window) {
|
|
1987
1970
|
|
1988
1971
|
}
|
1989
1972
|
|
1973
|
+
/* global: toDebugString: true */
|
1974
|
+
|
1975
|
+
function serializeObject(obj) {
|
1976
|
+
var seen = [];
|
1977
|
+
|
1978
|
+
return JSON.stringify(obj, function(key, val) {
|
1979
|
+
val = toJsonReplacer(key, val);
|
1980
|
+
if (isObject(val)) {
|
1981
|
+
|
1982
|
+
if (seen.indexOf(val) >= 0) return '<<already seen>>';
|
1983
|
+
|
1984
|
+
seen.push(val);
|
1985
|
+
}
|
1986
|
+
return val;
|
1987
|
+
});
|
1988
|
+
}
|
1989
|
+
|
1990
|
+
function toDebugString(obj) {
|
1991
|
+
if (typeof obj === 'function') {
|
1992
|
+
return obj.toString().replace(/ \{[\s\S]*$/, '');
|
1993
|
+
} else if (typeof obj === 'undefined') {
|
1994
|
+
return 'undefined';
|
1995
|
+
} else if (typeof obj !== 'string') {
|
1996
|
+
return serializeObject(obj);
|
1997
|
+
}
|
1998
|
+
return obj;
|
1999
|
+
}
|
2000
|
+
|
1990
2001
|
/* global angularModule: true,
|
1991
2002
|
version: true,
|
1992
2003
|
|
@@ -2089,11 +2100,11 @@ function setupModuleLoader(window) {
|
|
2089
2100
|
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
|
2090
2101
|
*/
|
2091
2102
|
var version = {
|
2092
|
-
full: '1.3.
|
2103
|
+
full: '1.3.3', // all of these placeholder strings will be replaced by grunt's
|
2093
2104
|
major: 1, // package task
|
2094
2105
|
minor: 3,
|
2095
|
-
dot:
|
2096
|
-
codeName: '
|
2106
|
+
dot: 3,
|
2107
|
+
codeName: 'undersea-arithmetic'
|
2097
2108
|
};
|
2098
2109
|
|
2099
2110
|
|
@@ -2826,7 +2837,7 @@ forEach({
|
|
2826
2837
|
}
|
2827
2838
|
} else {
|
2828
2839
|
return (element[name] ||
|
2829
|
-
(element.attributes.getNamedItem(name)|| noop).specified)
|
2840
|
+
(element.attributes.getNamedItem(name) || noop).specified)
|
2830
2841
|
? lowercasedName
|
2831
2842
|
: undefined;
|
2832
2843
|
}
|
@@ -4162,7 +4173,7 @@ function $AnchorScrollProvider() {
|
|
4162
4173
|
* @name $anchorScrollProvider#disableAutoScrolling
|
4163
4174
|
*
|
4164
4175
|
* @description
|
4165
|
-
* By default, {@link ng.$anchorScroll $anchorScroll()} will automatically
|
4176
|
+
* By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to
|
4166
4177
|
* {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.<br />
|
4167
4178
|
* Use this method to disable automatic scrolling.
|
4168
4179
|
*
|
@@ -4811,8 +4822,7 @@ function $$AsyncCallbackProvider() {
|
|
4811
4822
|
/**
|
4812
4823
|
* @param {object} window The global window object.
|
4813
4824
|
* @param {object} document jQuery wrapped document.
|
4814
|
-
* @param {
|
4815
|
-
* @param {object} $log console.log or an object with the same interface.
|
4825
|
+
* @param {object} $log window.console or an object with the same interface.
|
4816
4826
|
* @param {object} $sniffer $sniffer service
|
4817
4827
|
*/
|
4818
4828
|
function Browser(window, document, $log, $sniffer) {
|
@@ -5162,8 +5172,8 @@ function Browser(window, document, $log, $sniffer) {
|
|
5162
5172
|
// - 20 cookies per unique domain
|
5163
5173
|
// - 4096 bytes per cookie
|
5164
5174
|
if (cookieLength > 4096) {
|
5165
|
-
$log.warn("Cookie '"+ name +
|
5166
|
-
"' possibly not set or overflowed because it was too large ("+
|
5175
|
+
$log.warn("Cookie '" + name +
|
5176
|
+
"' possibly not set or overflowed because it was too large (" +
|
5167
5177
|
cookieLength + " > 4096 bytes)!");
|
5168
5178
|
}
|
5169
5179
|
}
|
@@ -5828,7 +5838,7 @@ function $TemplateCacheProvider() {
|
|
5828
5838
|
*
|
5829
5839
|
*
|
5830
5840
|
* #### `bindToController`
|
5831
|
-
* When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController` will
|
5841
|
+
* When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will
|
5832
5842
|
* allow a component to have its properties bound to the controller, rather than to scope. When the controller
|
5833
5843
|
* is instantiated, the initial values of the isolate scope bindings are already available.
|
5834
5844
|
*
|
@@ -6677,16 +6687,16 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
6677
6687
|
|
6678
6688
|
// for each tuples
|
6679
6689
|
var nbrUrisWith2parts = Math.floor(rawUris.length / 2);
|
6680
|
-
for (var i=0; i<nbrUrisWith2parts; i++) {
|
6681
|
-
var innerIdx = i*2;
|
6690
|
+
for (var i = 0; i < nbrUrisWith2parts; i++) {
|
6691
|
+
var innerIdx = i * 2;
|
6682
6692
|
// sanitize the uri
|
6683
6693
|
result += $$sanitizeUri(trim(rawUris[innerIdx]), true);
|
6684
6694
|
// add the descriptor
|
6685
|
-
result += (" " + trim(rawUris[innerIdx+1]));
|
6695
|
+
result += (" " + trim(rawUris[innerIdx + 1]));
|
6686
6696
|
}
|
6687
6697
|
|
6688
6698
|
// split the last item into uri and descriptor
|
6689
|
-
var lastTuple = trim(rawUris[i*2]).split(/\s/);
|
6699
|
+
var lastTuple = trim(rawUris[i * 2]).split(/\s/);
|
6690
6700
|
|
6691
6701
|
// sanitize the last uri
|
6692
6702
|
result += $$sanitizeUri(trim(lastTuple[0]), true);
|
@@ -6880,7 +6890,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
6880
6890
|
if (!node) {
|
6881
6891
|
return 'html';
|
6882
6892
|
} else {
|
6883
|
-
return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/) ? 'svg': 'html';
|
6893
|
+
return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/) ? 'svg' : 'html';
|
6884
6894
|
}
|
6885
6895
|
}
|
6886
6896
|
|
@@ -7693,7 +7703,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
7693
7703
|
var match = null;
|
7694
7704
|
if (hasDirectives.hasOwnProperty(name)) {
|
7695
7705
|
for (var directive, directives = $injector.get(name + Suffix),
|
7696
|
-
i = 0, ii = directives.length; i<ii; i++) {
|
7706
|
+
i = 0, ii = directives.length; i < ii; i++) {
|
7697
7707
|
try {
|
7698
7708
|
directive = directives[i];
|
7699
7709
|
if ((maxPriority === undefined || maxPriority > directive.priority) &&
|
@@ -7722,7 +7732,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
7722
7732
|
function directiveIsMultiElement(name) {
|
7723
7733
|
if (hasDirectives.hasOwnProperty(name)) {
|
7724
7734
|
for (var directive, directives = $injector.get(name + Suffix),
|
7725
|
-
i = 0, ii = directives.length; i<ii; i++) {
|
7735
|
+
i = 0, ii = directives.length; i < ii; i++) {
|
7726
7736
|
directive = directives[i];
|
7727
7737
|
if (directive.multiElement) {
|
7728
7738
|
return true;
|
@@ -7941,7 +7951,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
7941
7951
|
case 'svg':
|
7942
7952
|
case 'math':
|
7943
7953
|
var wrapper = document.createElement('div');
|
7944
|
-
wrapper.innerHTML = '<'+type+'>'+template+'</'+type+'>';
|
7954
|
+
wrapper.innerHTML = '<' + type + '>' + template + '</' + type + '>';
|
7945
7955
|
return wrapper.childNodes[0].childNodes;
|
7946
7956
|
default:
|
7947
7957
|
return template;
|
@@ -8298,6 +8308,10 @@ function $ControllerProvider() {
|
|
8298
8308
|
* * if $controllerProvider#allowGlobals, check `window[constructor]` on the global
|
8299
8309
|
* `window` object (not recommended)
|
8300
8310
|
*
|
8311
|
+
* The string can use the `controller as property` syntax, where the controller instance is published
|
8312
|
+
* as the specified property on the `scope`; the `scope` must be injected into `locals` param for this
|
8313
|
+
* to work correctly.
|
8314
|
+
*
|
8301
8315
|
* @param {Object} locals Injection locals for Controller.
|
8302
8316
|
* @return {Object} Instance of given controller.
|
8303
8317
|
*
|
@@ -8472,7 +8486,7 @@ function defaultHttpResponseTransform(data, headers) {
|
|
8472
8486
|
// strip json vulnerability protection prefix
|
8473
8487
|
data = data.replace(JSON_PROTECTION_PREFIX, '');
|
8474
8488
|
var contentType = headers('Content-Type');
|
8475
|
-
if ((contentType && contentType.indexOf(APPLICATION_JSON) === 0) ||
|
8489
|
+
if ((contentType && contentType.indexOf(APPLICATION_JSON) === 0 && data.trim()) ||
|
8476
8490
|
(JSON_START.test(data) && JSON_END.test(data))) {
|
8477
8491
|
data = fromJson(data);
|
8478
8492
|
}
|
@@ -10043,7 +10057,8 @@ function $InterpolateProvider() {
|
|
10043
10057
|
|
10044
10058
|
function parseStringifyInterceptor(value) {
|
10045
10059
|
try {
|
10046
|
-
|
10060
|
+
value = getValue(value);
|
10061
|
+
return allOrNothing && !isDefined(value) ? value : stringify(value);
|
10047
10062
|
} catch (err) {
|
10048
10063
|
var newErr = $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text,
|
10049
10064
|
err.toString());
|
@@ -10367,8 +10382,8 @@ function encodePath(path) {
|
|
10367
10382
|
return segments.join('/');
|
10368
10383
|
}
|
10369
10384
|
|
10370
|
-
function parseAbsoluteUrl(absoluteUrl, locationObj
|
10371
|
-
var parsedUrl = urlResolve(absoluteUrl
|
10385
|
+
function parseAbsoluteUrl(absoluteUrl, locationObj) {
|
10386
|
+
var parsedUrl = urlResolve(absoluteUrl);
|
10372
10387
|
|
10373
10388
|
locationObj.$$protocol = parsedUrl.protocol;
|
10374
10389
|
locationObj.$$host = parsedUrl.hostname;
|
@@ -10376,12 +10391,12 @@ function parseAbsoluteUrl(absoluteUrl, locationObj, appBase) {
|
|
10376
10391
|
}
|
10377
10392
|
|
10378
10393
|
|
10379
|
-
function parseAppUrl(relativeUrl, locationObj
|
10394
|
+
function parseAppUrl(relativeUrl, locationObj) {
|
10380
10395
|
var prefixed = (relativeUrl.charAt(0) !== '/');
|
10381
10396
|
if (prefixed) {
|
10382
10397
|
relativeUrl = '/' + relativeUrl;
|
10383
10398
|
}
|
10384
|
-
var match = urlResolve(relativeUrl
|
10399
|
+
var match = urlResolve(relativeUrl);
|
10385
10400
|
locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?
|
10386
10401
|
match.pathname.substring(1) : match.pathname);
|
10387
10402
|
locationObj.$$search = parseKeyValue(match.search);
|
@@ -10436,7 +10451,7 @@ function LocationHtml5Url(appBase, basePrefix) {
|
|
10436
10451
|
this.$$html5 = true;
|
10437
10452
|
basePrefix = basePrefix || '';
|
10438
10453
|
var appBaseNoFile = stripFile(appBase);
|
10439
|
-
parseAbsoluteUrl(appBase, this
|
10454
|
+
parseAbsoluteUrl(appBase, this);
|
10440
10455
|
|
10441
10456
|
|
10442
10457
|
/**
|
@@ -10451,7 +10466,7 @@ function LocationHtml5Url(appBase, basePrefix) {
|
|
10451
10466
|
appBaseNoFile);
|
10452
10467
|
}
|
10453
10468
|
|
10454
|
-
parseAppUrl(pathUrl, this
|
10469
|
+
parseAppUrl(pathUrl, this);
|
10455
10470
|
|
10456
10471
|
if (!this.$$path) {
|
10457
10472
|
this.$$path = '/';
|
@@ -10514,7 +10529,7 @@ function LocationHtml5Url(appBase, basePrefix) {
|
|
10514
10529
|
function LocationHashbangUrl(appBase, hashPrefix) {
|
10515
10530
|
var appBaseNoFile = stripFile(appBase);
|
10516
10531
|
|
10517
|
-
parseAbsoluteUrl(appBase, this
|
10532
|
+
parseAbsoluteUrl(appBase, this);
|
10518
10533
|
|
10519
10534
|
|
10520
10535
|
/**
|
@@ -10534,7 +10549,7 @@ function LocationHashbangUrl(appBase, hashPrefix) {
|
|
10534
10549
|
throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url,
|
10535
10550
|
hashPrefix);
|
10536
10551
|
}
|
10537
|
-
parseAppUrl(withoutHashUrl, this
|
10552
|
+
parseAppUrl(withoutHashUrl, this);
|
10538
10553
|
|
10539
10554
|
this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);
|
10540
10555
|
|
@@ -11174,11 +11189,19 @@ function $LocationProvider() {
|
|
11174
11189
|
$rootScope.$evalAsync(function() {
|
11175
11190
|
var oldUrl = $location.absUrl();
|
11176
11191
|
var oldState = $location.$$state;
|
11192
|
+
var defaultPrevented;
|
11177
11193
|
|
11178
11194
|
$location.$$parse(newUrl);
|
11179
11195
|
$location.$$state = newState;
|
11180
|
-
|
11181
|
-
|
11196
|
+
|
11197
|
+
defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
|
11198
|
+
newState, oldState).defaultPrevented;
|
11199
|
+
|
11200
|
+
// if the location was changed by a `$locationChangeStart` handler then stop
|
11201
|
+
// processing this location change
|
11202
|
+
if ($location.absUrl() !== newUrl) return;
|
11203
|
+
|
11204
|
+
if (defaultPrevented) {
|
11182
11205
|
$location.$$parse(oldUrl);
|
11183
11206
|
$location.$$state = oldState;
|
11184
11207
|
setBrowserUrlWithFallback(oldUrl, false, oldState);
|
@@ -11202,13 +11225,20 @@ function $LocationProvider() {
|
|
11202
11225
|
initializing = false;
|
11203
11226
|
|
11204
11227
|
$rootScope.$evalAsync(function() {
|
11205
|
-
|
11206
|
-
|
11228
|
+
var newUrl = $location.absUrl();
|
11229
|
+
var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
|
11230
|
+
$location.$$state, oldState).defaultPrevented;
|
11231
|
+
|
11232
|
+
// if the location was changed by a `$locationChangeStart` handler then stop
|
11233
|
+
// processing this location change
|
11234
|
+
if ($location.absUrl() !== newUrl) return;
|
11235
|
+
|
11236
|
+
if (defaultPrevented) {
|
11207
11237
|
$location.$$parse(oldUrl);
|
11208
11238
|
$location.$$state = oldState;
|
11209
11239
|
} else {
|
11210
11240
|
if (urlOrStateChanged) {
|
11211
|
-
setBrowserUrlWithFallback(
|
11241
|
+
setBrowserUrlWithFallback(newUrl, currentReplace,
|
11212
11242
|
oldState === $location.$$state ? null : $location.$$state);
|
11213
11243
|
}
|
11214
11244
|
afterLocationChange(oldUrl, oldState);
|
@@ -11398,7 +11428,7 @@ var $parseMinErr = minErr('$parse');
|
|
11398
11428
|
// Sandboxing Angular Expressions
|
11399
11429
|
// ------------------------------
|
11400
11430
|
// Angular expressions are generally considered safe because these expressions only have direct
|
11401
|
-
// access to
|
11431
|
+
// access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by
|
11402
11432
|
// obtaining a reference to native JS functions such as the Function constructor.
|
11403
11433
|
//
|
11404
11434
|
// As an example, consider the following Angular expression:
|
@@ -11407,7 +11437,7 @@ var $parseMinErr = minErr('$parse');
|
|
11407
11437
|
//
|
11408
11438
|
// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits
|
11409
11439
|
// against the expression language, but not to prevent exploits that were enabled by exposing
|
11410
|
-
// sensitive JavaScript or browser
|
11440
|
+
// sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good
|
11411
11441
|
// practice and therefore we are not even trying to protect against interaction with an object
|
11412
11442
|
// explicitly exposed in this way.
|
11413
11443
|
//
|
@@ -11415,6 +11445,8 @@ var $parseMinErr = minErr('$parse');
|
|
11415
11445
|
// window or some DOM object that has a reference to window is published onto a Scope.
|
11416
11446
|
// Similarly we prevent invocations of function known to be dangerous, as well as assignments to
|
11417
11447
|
// native objects.
|
11448
|
+
//
|
11449
|
+
// See https://docs.angularjs.org/guide/security
|
11418
11450
|
|
11419
11451
|
|
11420
11452
|
function ensureSafeMemberName(name, fullExpression) {
|
@@ -11423,7 +11455,7 @@ function ensureSafeMemberName(name, fullExpression) {
|
|
11423
11455
|
|| name === "__proto__") {
|
11424
11456
|
throw $parseMinErr('isecfld',
|
11425
11457
|
'Attempting to access a disallowed field in Angular expressions! '
|
11426
|
-
+'Expression: {0}', fullExpression);
|
11458
|
+
+ 'Expression: {0}', fullExpression);
|
11427
11459
|
}
|
11428
11460
|
return name;
|
11429
11461
|
}
|
@@ -11500,24 +11532,24 @@ var OPERATORS = extend(createMap(), {
|
|
11500
11532
|
}
|
11501
11533
|
return a;
|
11502
11534
|
}
|
11503
|
-
return isDefined(b)?b:undefined;},
|
11535
|
+
return isDefined(b) ? b : undefined;},
|
11504
11536
|
'-':function(self, locals, a, b) {
|
11505
11537
|
a=a(self, locals); b=b(self, locals);
|
11506
|
-
return (isDefined(a)?a:0)-(isDefined(b)?b:0);
|
11538
|
+
return (isDefined(a) ? a : 0) - (isDefined(b) ? b : 0);
|
11507
11539
|
},
|
11508
|
-
'*':function(self, locals, a, b) {return a(self, locals)*b(self, locals);},
|
11509
|
-
'/':function(self, locals, a, b) {return a(self, locals)/b(self, locals);},
|
11510
|
-
'%':function(self, locals, a, b) {return a(self, locals)%b(self, locals);},
|
11511
|
-
'===':function(self, locals, a, b) {return a(self, locals)===b(self, locals);},
|
11512
|
-
'!==':function(self, locals, a, b) {return a(self, locals)!==b(self, locals);},
|
11513
|
-
'==':function(self, locals, a, b) {return a(self, locals)==b(self, locals);},
|
11514
|
-
'!=':function(self, locals, a, b) {return a(self, locals)!=b(self, locals);},
|
11515
|
-
'<':function(self, locals, a, b) {return a(self, locals)<b(self, locals);},
|
11516
|
-
'>':function(self, locals, a, b) {return a(self, locals)>b(self, locals);},
|
11517
|
-
'<=':function(self, locals, a, b) {return a(self, locals)<=b(self, locals);},
|
11518
|
-
'>=':function(self, locals, a, b) {return a(self, locals)>=b(self, locals);},
|
11519
|
-
'&&':function(self, locals, a, b) {return a(self, locals)&&b(self, locals);},
|
11520
|
-
'||':function(self, locals, a, b) {return a(self, locals)||b(self, locals);},
|
11540
|
+
'*':function(self, locals, a, b) {return a(self, locals) * b(self, locals);},
|
11541
|
+
'/':function(self, locals, a, b) {return a(self, locals) / b(self, locals);},
|
11542
|
+
'%':function(self, locals, a, b) {return a(self, locals) % b(self, locals);},
|
11543
|
+
'===':function(self, locals, a, b) {return a(self, locals) === b(self, locals);},
|
11544
|
+
'!==':function(self, locals, a, b) {return a(self, locals) !== b(self, locals);},
|
11545
|
+
'==':function(self, locals, a, b) {return a(self, locals) == b(self, locals);},
|
11546
|
+
'!=':function(self, locals, a, b) {return a(self, locals) != b(self, locals);},
|
11547
|
+
'<':function(self, locals, a, b) {return a(self, locals) < b(self, locals);},
|
11548
|
+
'>':function(self, locals, a, b) {return a(self, locals) > b(self, locals);},
|
11549
|
+
'<=':function(self, locals, a, b) {return a(self, locals) <= b(self, locals);},
|
11550
|
+
'>=':function(self, locals, a, b) {return a(self, locals) >= b(self, locals);},
|
11551
|
+
'&&':function(self, locals, a, b) {return a(self, locals) && b(self, locals);},
|
11552
|
+
'||':function(self, locals, a, b) {return a(self, locals) || b(self, locals);},
|
11521
11553
|
'!':function(self, locals, a) {return !a(self, locals);},
|
11522
11554
|
|
11523
11555
|
//Tokenized as operators but parsed as assignment/filters
|
@@ -11543,44 +11575,31 @@ Lexer.prototype = {
|
|
11543
11575
|
lex: function(text) {
|
11544
11576
|
this.text = text;
|
11545
11577
|
this.index = 0;
|
11546
|
-
this.ch = undefined;
|
11547
11578
|
this.tokens = [];
|
11548
11579
|
|
11549
11580
|
while (this.index < this.text.length) {
|
11550
|
-
|
11551
|
-
if (
|
11552
|
-
this.readString(
|
11553
|
-
} else if (this.isNumber(
|
11581
|
+
var ch = this.text.charAt(this.index);
|
11582
|
+
if (ch === '"' || ch === "'") {
|
11583
|
+
this.readString(ch);
|
11584
|
+
} else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {
|
11554
11585
|
this.readNumber();
|
11555
|
-
} else if (this.isIdent(
|
11586
|
+
} else if (this.isIdent(ch)) {
|
11556
11587
|
this.readIdent();
|
11557
|
-
} else if (this.is('(){}[].,;:?')) {
|
11558
|
-
this.tokens.push({
|
11559
|
-
index: this.index,
|
11560
|
-
text: this.ch
|
11561
|
-
});
|
11588
|
+
} else if (this.is(ch, '(){}[].,;:?')) {
|
11589
|
+
this.tokens.push({index: this.index, text: ch});
|
11562
11590
|
this.index++;
|
11563
|
-
} else if (this.isWhitespace(
|
11591
|
+
} else if (this.isWhitespace(ch)) {
|
11564
11592
|
this.index++;
|
11565
11593
|
} else {
|
11566
|
-
var ch2 =
|
11594
|
+
var ch2 = ch + this.peek();
|
11567
11595
|
var ch3 = ch2 + this.peek(2);
|
11568
|
-
var
|
11569
|
-
var
|
11570
|
-
var
|
11571
|
-
if (
|
11572
|
-
|
11573
|
-
this.index
|
11574
|
-
|
11575
|
-
this.tokens.push({index: this.index, text: ch2, fn: fn2});
|
11576
|
-
this.index += 2;
|
11577
|
-
} else if (fn) {
|
11578
|
-
this.tokens.push({
|
11579
|
-
index: this.index,
|
11580
|
-
text: this.ch,
|
11581
|
-
fn: fn
|
11582
|
-
});
|
11583
|
-
this.index += 1;
|
11596
|
+
var op1 = OPERATORS[ch];
|
11597
|
+
var op2 = OPERATORS[ch2];
|
11598
|
+
var op3 = OPERATORS[ch3];
|
11599
|
+
if (op1 || op2 || op3) {
|
11600
|
+
var token = op3 ? ch3 : (op2 ? ch2 : ch);
|
11601
|
+
this.tokens.push({index: this.index, text: token, operator: true});
|
11602
|
+
this.index += token.length;
|
11584
11603
|
} else {
|
11585
11604
|
this.throwError('Unexpected next character ', this.index, this.index + 1);
|
11586
11605
|
}
|
@@ -11589,8 +11608,8 @@ Lexer.prototype = {
|
|
11589
11608
|
return this.tokens;
|
11590
11609
|
},
|
11591
11610
|
|
11592
|
-
is: function(chars) {
|
11593
|
-
return chars.indexOf(
|
11611
|
+
is: function(ch, chars) {
|
11612
|
+
return chars.indexOf(ch) !== -1;
|
11594
11613
|
},
|
11595
11614
|
|
11596
11615
|
peek: function(i) {
|
@@ -11599,7 +11618,7 @@ Lexer.prototype = {
|
|
11599
11618
|
},
|
11600
11619
|
|
11601
11620
|
isNumber: function(ch) {
|
11602
|
-
return ('0' <= ch && ch <= '9');
|
11621
|
+
return ('0' <= ch && ch <= '9') && typeof ch === "string";
|
11603
11622
|
},
|
11604
11623
|
|
11605
11624
|
isWhitespace: function(ch) {
|
@@ -11652,79 +11671,28 @@ Lexer.prototype = {
|
|
11652
11671
|
}
|
11653
11672
|
this.index++;
|
11654
11673
|
}
|
11655
|
-
number = 1 * number;
|
11656
11674
|
this.tokens.push({
|
11657
11675
|
index: start,
|
11658
11676
|
text: number,
|
11659
11677
|
constant: true,
|
11660
|
-
|
11678
|
+
value: Number(number)
|
11661
11679
|
});
|
11662
11680
|
},
|
11663
11681
|
|
11664
11682
|
readIdent: function() {
|
11665
|
-
var expression = this.text;
|
11666
|
-
|
11667
|
-
var ident = '';
|
11668
11683
|
var start = this.index;
|
11669
|
-
|
11670
|
-
var lastDot, peekIndex, methodName, ch;
|
11671
|
-
|
11672
11684
|
while (this.index < this.text.length) {
|
11673
|
-
ch = this.text.charAt(this.index);
|
11674
|
-
if (
|
11675
|
-
if (ch === '.') lastDot = this.index;
|
11676
|
-
ident += ch;
|
11677
|
-
} else {
|
11685
|
+
var ch = this.text.charAt(this.index);
|
11686
|
+
if (!(this.isIdent(ch) || this.isNumber(ch))) {
|
11678
11687
|
break;
|
11679
11688
|
}
|
11680
11689
|
this.index++;
|
11681
11690
|
}
|
11682
|
-
|
11683
|
-
//check if the identifier ends with . and if so move back one char
|
11684
|
-
if (lastDot && ident[ident.length - 1] === '.') {
|
11685
|
-
this.index--;
|
11686
|
-
ident = ident.slice(0, -1);
|
11687
|
-
lastDot = ident.lastIndexOf('.');
|
11688
|
-
if (lastDot === -1) {
|
11689
|
-
lastDot = undefined;
|
11690
|
-
}
|
11691
|
-
}
|
11692
|
-
|
11693
|
-
//check if this is not a method invocation and if it is back out to last dot
|
11694
|
-
if (lastDot) {
|
11695
|
-
peekIndex = this.index;
|
11696
|
-
while (peekIndex < this.text.length) {
|
11697
|
-
ch = this.text.charAt(peekIndex);
|
11698
|
-
if (ch === '(') {
|
11699
|
-
methodName = ident.substr(lastDot - start + 1);
|
11700
|
-
ident = ident.substr(0, lastDot - start);
|
11701
|
-
this.index = peekIndex;
|
11702
|
-
break;
|
11703
|
-
}
|
11704
|
-
if (this.isWhitespace(ch)) {
|
11705
|
-
peekIndex++;
|
11706
|
-
} else {
|
11707
|
-
break;
|
11708
|
-
}
|
11709
|
-
}
|
11710
|
-
}
|
11711
|
-
|
11712
11691
|
this.tokens.push({
|
11713
11692
|
index: start,
|
11714
|
-
text:
|
11715
|
-
|
11693
|
+
text: this.text.slice(start, this.index),
|
11694
|
+
identifier: true
|
11716
11695
|
});
|
11717
|
-
|
11718
|
-
if (methodName) {
|
11719
|
-
this.tokens.push({
|
11720
|
-
index: lastDot,
|
11721
|
-
text: '.'
|
11722
|
-
});
|
11723
|
-
this.tokens.push({
|
11724
|
-
index: lastDot + 1,
|
11725
|
-
text: methodName
|
11726
|
-
});
|
11727
|
-
}
|
11728
11696
|
},
|
11729
11697
|
|
11730
11698
|
readString: function(quote) {
|
@@ -11755,9 +11723,8 @@ Lexer.prototype = {
|
|
11755
11723
|
this.tokens.push({
|
11756
11724
|
index: start,
|
11757
11725
|
text: rawString,
|
11758
|
-
string: string,
|
11759
11726
|
constant: true,
|
11760
|
-
|
11727
|
+
value: string
|
11761
11728
|
});
|
11762
11729
|
return;
|
11763
11730
|
} else {
|
@@ -11818,16 +11785,12 @@ Parser.prototype = {
|
|
11818
11785
|
primary = this.arrayDeclaration();
|
11819
11786
|
} else if (this.expect('{')) {
|
11820
11787
|
primary = this.object();
|
11788
|
+
} else if (this.peek().identifier) {
|
11789
|
+
primary = this.identifier();
|
11790
|
+
} else if (this.peek().constant) {
|
11791
|
+
primary = this.constant();
|
11821
11792
|
} else {
|
11822
|
-
|
11823
|
-
primary = token.fn;
|
11824
|
-
if (!primary) {
|
11825
|
-
this.throwError('not a primary expression', token);
|
11826
|
-
}
|
11827
|
-
if (token.constant) {
|
11828
|
-
primary.constant = true;
|
11829
|
-
primary.literal = true;
|
11830
|
-
}
|
11793
|
+
this.throwError('not a primary expression', this.peek());
|
11831
11794
|
}
|
11832
11795
|
|
11833
11796
|
var next, context;
|
@@ -11861,8 +11824,11 @@ Parser.prototype = {
|
|
11861
11824
|
},
|
11862
11825
|
|
11863
11826
|
peek: function(e1, e2, e3, e4) {
|
11864
|
-
|
11865
|
-
|
11827
|
+
return this.peekAhead(0, e1, e2, e3, e4);
|
11828
|
+
},
|
11829
|
+
peekAhead: function(i, e1, e2, e3, e4) {
|
11830
|
+
if (this.tokens.length > i) {
|
11831
|
+
var token = this.tokens[i];
|
11866
11832
|
var t = token.text;
|
11867
11833
|
if (t === e1 || t === e2 || t === e3 || t === e4 ||
|
11868
11834
|
(!e1 && !e2 && !e3 && !e4)) {
|
@@ -11882,12 +11848,19 @@ Parser.prototype = {
|
|
11882
11848
|
},
|
11883
11849
|
|
11884
11850
|
consume: function(e1) {
|
11885
|
-
if (
|
11851
|
+
if (this.tokens.length === 0) {
|
11852
|
+
throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);
|
11853
|
+
}
|
11854
|
+
|
11855
|
+
var token = this.expect(e1);
|
11856
|
+
if (!token) {
|
11886
11857
|
this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());
|
11887
11858
|
}
|
11859
|
+
return token;
|
11888
11860
|
},
|
11889
11861
|
|
11890
|
-
unaryFn: function(
|
11862
|
+
unaryFn: function(op, right) {
|
11863
|
+
var fn = OPERATORS[op];
|
11891
11864
|
return extend(function $parseUnaryFn(self, locals) {
|
11892
11865
|
return fn(self, locals, right);
|
11893
11866
|
}, {
|
@@ -11896,7 +11869,8 @@ Parser.prototype = {
|
|
11896
11869
|
});
|
11897
11870
|
},
|
11898
11871
|
|
11899
|
-
binaryFn: function(left,
|
11872
|
+
binaryFn: function(left, op, right, isBranching) {
|
11873
|
+
var fn = OPERATORS[op];
|
11900
11874
|
return extend(function $parseBinaryFn(self, locals) {
|
11901
11875
|
return fn(self, locals, left, right);
|
11902
11876
|
}, {
|
@@ -11905,6 +11879,28 @@ Parser.prototype = {
|
|
11905
11879
|
});
|
11906
11880
|
},
|
11907
11881
|
|
11882
|
+
identifier: function() {
|
11883
|
+
var id = this.consume().text;
|
11884
|
+
|
11885
|
+
//Continue reading each `.identifier` unless it is a method invocation
|
11886
|
+
while (this.peek('.') && this.peekAhead(1).identifier && !this.peekAhead(2, '(')) {
|
11887
|
+
id += this.consume().text + this.consume().text;
|
11888
|
+
}
|
11889
|
+
|
11890
|
+
return CONSTANTS[id] || getterFn(id, this.options, this.text);
|
11891
|
+
},
|
11892
|
+
|
11893
|
+
constant: function() {
|
11894
|
+
var value = this.consume().value;
|
11895
|
+
|
11896
|
+
return extend(function $parseConstant() {
|
11897
|
+
return value;
|
11898
|
+
}, {
|
11899
|
+
constant: true,
|
11900
|
+
literal: true
|
11901
|
+
});
|
11902
|
+
},
|
11903
|
+
|
11908
11904
|
statements: function() {
|
11909
11905
|
var statements = [];
|
11910
11906
|
while (true) {
|
@@ -11936,8 +11932,7 @@ Parser.prototype = {
|
|
11936
11932
|
},
|
11937
11933
|
|
11938
11934
|
filter: function(inputFn) {
|
11939
|
-
var
|
11940
|
-
var fn = this.$filter(token.text);
|
11935
|
+
var fn = this.$filter(this.consume().text);
|
11941
11936
|
var argsFn;
|
11942
11937
|
var args;
|
11943
11938
|
|
@@ -12000,7 +11995,7 @@ Parser.prototype = {
|
|
12000
11995
|
var token;
|
12001
11996
|
if ((token = this.expect('?'))) {
|
12002
11997
|
middle = this.assignment();
|
12003
|
-
if (
|
11998
|
+
if (this.consume(':')) {
|
12004
11999
|
var right = this.assignment();
|
12005
12000
|
|
12006
12001
|
return extend(function $parseTernary(self, locals) {
|
@@ -12008,9 +12003,6 @@ Parser.prototype = {
|
|
12008
12003
|
}, {
|
12009
12004
|
constant: left.constant && middle.constant && right.constant
|
12010
12005
|
});
|
12011
|
-
|
12012
|
-
} else {
|
12013
|
-
this.throwError('expected :', token);
|
12014
12006
|
}
|
12015
12007
|
}
|
12016
12008
|
|
@@ -12021,7 +12013,7 @@ Parser.prototype = {
|
|
12021
12013
|
var left = this.logicalAND();
|
12022
12014
|
var token;
|
12023
12015
|
while ((token = this.expect('||'))) {
|
12024
|
-
left = this.binaryFn(left, token.
|
12016
|
+
left = this.binaryFn(left, token.text, this.logicalAND(), true);
|
12025
12017
|
}
|
12026
12018
|
return left;
|
12027
12019
|
},
|
@@ -12030,7 +12022,7 @@ Parser.prototype = {
|
|
12030
12022
|
var left = this.equality();
|
12031
12023
|
var token;
|
12032
12024
|
if ((token = this.expect('&&'))) {
|
12033
|
-
left = this.binaryFn(left, token.
|
12025
|
+
left = this.binaryFn(left, token.text, this.logicalAND(), true);
|
12034
12026
|
}
|
12035
12027
|
return left;
|
12036
12028
|
},
|
@@ -12039,7 +12031,7 @@ Parser.prototype = {
|
|
12039
12031
|
var left = this.relational();
|
12040
12032
|
var token;
|
12041
12033
|
if ((token = this.expect('==','!=','===','!=='))) {
|
12042
|
-
left = this.binaryFn(left, token.
|
12034
|
+
left = this.binaryFn(left, token.text, this.equality());
|
12043
12035
|
}
|
12044
12036
|
return left;
|
12045
12037
|
},
|
@@ -12048,7 +12040,7 @@ Parser.prototype = {
|
|
12048
12040
|
var left = this.additive();
|
12049
12041
|
var token;
|
12050
12042
|
if ((token = this.expect('<', '>', '<=', '>='))) {
|
12051
|
-
left = this.binaryFn(left, token.
|
12043
|
+
left = this.binaryFn(left, token.text, this.relational());
|
12052
12044
|
}
|
12053
12045
|
return left;
|
12054
12046
|
},
|
@@ -12057,7 +12049,7 @@ Parser.prototype = {
|
|
12057
12049
|
var left = this.multiplicative();
|
12058
12050
|
var token;
|
12059
12051
|
while ((token = this.expect('+','-'))) {
|
12060
|
-
left = this.binaryFn(left, token.
|
12052
|
+
left = this.binaryFn(left, token.text, this.multiplicative());
|
12061
12053
|
}
|
12062
12054
|
return left;
|
12063
12055
|
},
|
@@ -12066,7 +12058,7 @@ Parser.prototype = {
|
|
12066
12058
|
var left = this.unary();
|
12067
12059
|
var token;
|
12068
12060
|
while ((token = this.expect('*','/','%'))) {
|
12069
|
-
left = this.binaryFn(left, token.
|
12061
|
+
left = this.binaryFn(left, token.text, this.unary());
|
12070
12062
|
}
|
12071
12063
|
return left;
|
12072
12064
|
},
|
@@ -12076,9 +12068,9 @@ Parser.prototype = {
|
|
12076
12068
|
if (this.expect('+')) {
|
12077
12069
|
return this.primary();
|
12078
12070
|
} else if ((token = this.expect('-'))) {
|
12079
|
-
return this.binaryFn(Parser.ZERO, token.
|
12071
|
+
return this.binaryFn(Parser.ZERO, token.text, this.unary());
|
12080
12072
|
} else if ((token = this.expect('!'))) {
|
12081
|
-
return this.unaryFn(token.
|
12073
|
+
return this.unaryFn(token.text, this.unary());
|
12082
12074
|
} else {
|
12083
12075
|
return this.primary();
|
12084
12076
|
}
|
@@ -12086,7 +12078,7 @@ Parser.prototype = {
|
|
12086
12078
|
|
12087
12079
|
fieldAccess: function(object) {
|
12088
12080
|
var expression = this.text;
|
12089
|
-
var field = this.
|
12081
|
+
var field = this.consume().text;
|
12090
12082
|
var getter = getterFn(field, this.options, expression);
|
12091
12083
|
|
12092
12084
|
return extend(function $parseFieldAccess(scope, locals, self) {
|
@@ -12171,8 +12163,7 @@ Parser.prototype = {
|
|
12171
12163
|
// Support trailing commas per ES5.1.
|
12172
12164
|
break;
|
12173
12165
|
}
|
12174
|
-
|
12175
|
-
elementFns.push(elementFn);
|
12166
|
+
elementFns.push(this.expression());
|
12176
12167
|
} while (this.expect(','));
|
12177
12168
|
}
|
12178
12169
|
this.consume(']');
|
@@ -12198,11 +12189,16 @@ Parser.prototype = {
|
|
12198
12189
|
// Support trailing commas per ES5.1.
|
12199
12190
|
break;
|
12200
12191
|
}
|
12201
|
-
var token = this.
|
12202
|
-
|
12192
|
+
var token = this.consume();
|
12193
|
+
if (token.constant) {
|
12194
|
+
keys.push(token.value);
|
12195
|
+
} else if (token.identifier) {
|
12196
|
+
keys.push(token.text);
|
12197
|
+
} else {
|
12198
|
+
this.throwError("invalid key", token);
|
12199
|
+
}
|
12203
12200
|
this.consume(':');
|
12204
|
-
|
12205
|
-
valueFns.push(value);
|
12201
|
+
valueFns.push(this.expression());
|
12206
12202
|
} while (this.expect(','));
|
12207
12203
|
}
|
12208
12204
|
this.consume('}');
|
@@ -12644,13 +12640,21 @@ function $ParseProvider() {
|
|
12644
12640
|
|
12645
12641
|
function addInterceptor(parsedExpression, interceptorFn) {
|
12646
12642
|
if (!interceptorFn) return parsedExpression;
|
12643
|
+
var watchDelegate = parsedExpression.$$watchDelegate;
|
12647
12644
|
|
12648
|
-
var
|
12645
|
+
var regularWatch =
|
12646
|
+
watchDelegate !== oneTimeLiteralWatchDelegate &&
|
12647
|
+
watchDelegate !== oneTimeWatchDelegate;
|
12648
|
+
|
12649
|
+
var fn = regularWatch ? function regularInterceptedExpression(scope, locals) {
|
12650
|
+
var value = parsedExpression(scope, locals);
|
12651
|
+
return interceptorFn(value, scope, locals);
|
12652
|
+
} : function oneTimeInterceptedExpression(scope, locals) {
|
12649
12653
|
var value = parsedExpression(scope, locals);
|
12650
12654
|
var result = interceptorFn(value, scope, locals);
|
12651
12655
|
// we only return the interceptor's result if the
|
12652
12656
|
// initial value is defined (for bind-once)
|
12653
|
-
return isDefined(value)
|
12657
|
+
return isDefined(value) ? result : value;
|
12654
12658
|
};
|
12655
12659
|
|
12656
12660
|
// Propagate $$watchDelegates other then inputsWatchDelegate
|
@@ -12675,7 +12679,11 @@ function $ParseProvider() {
|
|
12675
12679
|
* @requires $rootScope
|
12676
12680
|
*
|
12677
12681
|
* @description
|
12678
|
-
* A
|
12682
|
+
* A service that helps you run functions asynchronously, and use their return values (or exceptions)
|
12683
|
+
* when they are done processing.
|
12684
|
+
*
|
12685
|
+
* This is an implementation of promises/deferred objects inspired by
|
12686
|
+
* [Kris Kowal's Q](https://github.com/kriskowal/q).
|
12679
12687
|
*
|
12680
12688
|
* $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred
|
12681
12689
|
* implementations, and the other which resembles ES6 promises to some degree.
|
@@ -12811,16 +12819,12 @@ function $ParseProvider() {
|
|
12811
12819
|
*
|
12812
12820
|
* - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`
|
12813
12821
|
*
|
12814
|
-
* - `finally(callback)` – allows you to observe either the fulfillment or rejection of a promise,
|
12822
|
+
* - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise,
|
12815
12823
|
* but to do so without modifying the final value. This is useful to release resources or do some
|
12816
12824
|
* clean-up that needs to be done whether the promise was rejected or resolved. See the [full
|
12817
12825
|
* specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for
|
12818
12826
|
* more information.
|
12819
12827
|
*
|
12820
|
-
* Because `finally` is a reserved word in JavaScript and reserved keywords are not supported as
|
12821
|
-
* property names by ES3, you'll need to invoke the method like `promise['finally'](callback)` to
|
12822
|
-
* make your code IE8 and Android 2.x compatible.
|
12823
|
-
*
|
12824
12828
|
* # Chaining promises
|
12825
12829
|
*
|
12826
12830
|
* Because calling the `then` method of a promise returns a new derived promise, it is easily
|
@@ -14043,11 +14047,11 @@ function $RootScopeProvider() {
|
|
14043
14047
|
if (ttl < 5) {
|
14044
14048
|
logIdx = 4 - ttl;
|
14045
14049
|
if (!watchLog[logIdx]) watchLog[logIdx] = [];
|
14046
|
-
|
14047
|
-
|
14048
|
-
|
14049
|
-
|
14050
|
-
|
14050
|
+
watchLog[logIdx].push({
|
14051
|
+
msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,
|
14052
|
+
newVal: value,
|
14053
|
+
oldVal: last
|
14054
|
+
});
|
14051
14055
|
}
|
14052
14056
|
} else if (watch === lastDirtyWatch) {
|
14053
14057
|
// If the most recently dirty watcher is now clean, short circuit since the remaining watchers
|
@@ -14080,7 +14084,7 @@ function $RootScopeProvider() {
|
|
14080
14084
|
throw $rootScopeMinErr('infdig',
|
14081
14085
|
'{0} $digest() iterations reached. Aborting!\n' +
|
14082
14086
|
'Watchers fired in the last 5 iterations: {1}',
|
14083
|
-
TTL,
|
14087
|
+
TTL, watchLog);
|
14084
14088
|
}
|
14085
14089
|
|
14086
14090
|
} while (dirty || asyncQueue.length);
|
@@ -14431,7 +14435,7 @@ function $RootScopeProvider() {
|
|
14431
14435
|
do {
|
14432
14436
|
namedListeners = scope.$$listeners[name] || empty;
|
14433
14437
|
event.currentScope = scope;
|
14434
|
-
for (i=0, length=namedListeners.length; i<length; i++) {
|
14438
|
+
for (i = 0, length = namedListeners.length; i < length; i++) {
|
14435
14439
|
|
14436
14440
|
// if listeners were deregistered, defragment the array
|
14437
14441
|
if (!namedListeners[i]) {
|
@@ -14505,7 +14509,7 @@ function $RootScopeProvider() {
|
|
14505
14509
|
while ((current = next)) {
|
14506
14510
|
event.currentScope = current;
|
14507
14511
|
listeners = current.$$listeners[name] || [];
|
14508
|
-
for (i=0, length = listeners.length; i<length; i++) {
|
14512
|
+
for (i = 0, length = listeners.length; i < length; i++) {
|
14509
14513
|
// if listeners were deregistered, defragment the array
|
14510
14514
|
if (!listeners[i]) {
|
14511
14515
|
listeners.splice(i, 1);
|
@@ -14661,7 +14665,7 @@ function $$SanitizeUriProvider() {
|
|
14661
14665
|
var normalizedVal;
|
14662
14666
|
normalizedVal = urlResolve(uri).href;
|
14663
14667
|
if (normalizedVal !== '' && !normalizedVal.match(regex)) {
|
14664
|
-
return 'unsafe:'+normalizedVal;
|
14668
|
+
return 'unsafe:' + normalizedVal;
|
14665
14669
|
}
|
14666
14670
|
return uri;
|
14667
14671
|
};
|
@@ -15760,7 +15764,7 @@ function $SnifferProvider() {
|
|
15760
15764
|
transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));
|
15761
15765
|
animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));
|
15762
15766
|
|
15763
|
-
if (android && (!transitions
|
15767
|
+
if (android && (!transitions || !animations)) {
|
15764
15768
|
transitions = isString(document.body.style.webkitTransition);
|
15765
15769
|
animations = isString(document.body.style.webkitAnimation);
|
15766
15770
|
}
|
@@ -15831,7 +15835,7 @@ function $TemplateRequestProvider() {
|
|
15831
15835
|
if (isArray(transformResponse)) {
|
15832
15836
|
var original = transformResponse;
|
15833
15837
|
transformResponse = [];
|
15834
|
-
for (var i=0; i<original.length; ++i) {
|
15838
|
+
for (var i = 0; i < original.length; ++i) {
|
15835
15839
|
var transformer = original[i];
|
15836
15840
|
if (transformer !== defaultHttpResponseTransform) {
|
15837
15841
|
transformResponse.push(transformer);
|
@@ -16075,7 +16079,7 @@ function $TimeoutProvider() {
|
|
16075
16079
|
// exactly the behavior needed here. There is little value is mocking these out for this
|
16076
16080
|
// service.
|
16077
16081
|
var urlParsingNode = document.createElement("a");
|
16078
|
-
var originUrl = urlResolve(window.location.href
|
16082
|
+
var originUrl = urlResolve(window.location.href);
|
16079
16083
|
|
16080
16084
|
|
16081
16085
|
/**
|
@@ -16130,7 +16134,7 @@ var originUrl = urlResolve(window.location.href, true);
|
|
16130
16134
|
* | pathname | The pathname, beginning with "/"
|
16131
16135
|
*
|
16132
16136
|
*/
|
16133
|
-
function urlResolve(url
|
16137
|
+
function urlResolve(url) {
|
16134
16138
|
var href = url;
|
16135
16139
|
|
16136
16140
|
if (msie) {
|
@@ -16510,8 +16514,8 @@ function filterFilter() {
|
|
16510
16514
|
}
|
16511
16515
|
return false;
|
16512
16516
|
}
|
16513
|
-
text = (''+text).toLowerCase();
|
16514
|
-
return (''+obj).toLowerCase().indexOf(text) > -1;
|
16517
|
+
text = ('' + text).toLowerCase();
|
16518
|
+
return ('' + obj).toLowerCase().indexOf(text) > -1;
|
16515
16519
|
};
|
16516
16520
|
}
|
16517
16521
|
}
|
@@ -16771,7 +16775,7 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
|
|
16771
16775
|
if (whole.length >= (lgroup + group)) {
|
16772
16776
|
pos = whole.length - lgroup;
|
16773
16777
|
for (i = 0; i < pos; i++) {
|
16774
|
-
if ((pos - i)%group === 0 && i !== 0) {
|
16778
|
+
if ((pos - i) % group === 0 && i !== 0) {
|
16775
16779
|
formatedText += groupSep;
|
16776
16780
|
}
|
16777
16781
|
formatedText += whole.charAt(i);
|
@@ -16779,7 +16783,7 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
|
|
16779
16783
|
}
|
16780
16784
|
|
16781
16785
|
for (i = pos; i < whole.length; i++) {
|
16782
|
-
if ((whole.length - i)%lgroup === 0 && i !== 0) {
|
16786
|
+
if ((whole.length - i) % lgroup === 0 && i !== 0) {
|
16783
16787
|
formatedText += groupSep;
|
16784
16788
|
}
|
16785
16789
|
formatedText += whole.charAt(i);
|
@@ -17019,10 +17023,10 @@ function dateFilter($locale) {
|
|
17019
17023
|
tzMin = int(match[9] + match[11]);
|
17020
17024
|
}
|
17021
17025
|
dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3]));
|
17022
|
-
var h = int(match[4]||0) - tzHour;
|
17023
|
-
var m = int(match[5]||0) - tzMin;
|
17024
|
-
var s = int(match[6]||0);
|
17025
|
-
var ms = Math.round(parseFloat('0.' + (match[7]||0)) * 1000);
|
17026
|
+
var h = int(match[4] || 0) - tzHour;
|
17027
|
+
var m = int(match[5] || 0) - tzMin;
|
17028
|
+
var s = int(match[6] || 0);
|
17029
|
+
var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);
|
17026
17030
|
timeSetter.call(date, h, m, s, ms);
|
17027
17031
|
return date;
|
17028
17032
|
}
|
@@ -17254,7 +17258,7 @@ function limitToFilter() {
|
|
17254
17258
|
n = input.length;
|
17255
17259
|
}
|
17256
17260
|
|
17257
|
-
for (; i<n; i++) {
|
17261
|
+
for (; i < n; i++) {
|
17258
17262
|
out.push(input[i]);
|
17259
17263
|
}
|
17260
17264
|
|
@@ -17381,7 +17385,7 @@ orderByFilter.$inject = ['$parse'];
|
|
17381
17385
|
function orderByFilter($parse) {
|
17382
17386
|
return function(array, sortPredicate, reverseOrder) {
|
17383
17387
|
if (!(isArrayLike(array))) return array;
|
17384
|
-
sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate];
|
17388
|
+
sortPredicate = isArray(sortPredicate) ? sortPredicate : [sortPredicate];
|
17385
17389
|
if (sortPredicate.length === 0) { sortPredicate = ['+']; }
|
17386
17390
|
sortPredicate = sortPredicate.map(function(predicate) {
|
17387
17391
|
var descending = false, get = predicate || identity;
|
@@ -17408,9 +17412,7 @@ function orderByFilter($parse) {
|
|
17408
17412
|
return compare(get(a),get(b));
|
17409
17413
|
}, descending);
|
17410
17414
|
});
|
17411
|
-
|
17412
|
-
for (var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); }
|
17413
|
-
return arrayCopy.sort(reverseComparator(comparator, reverseOrder));
|
17415
|
+
return slice.call(array).sort(reverseComparator(comparator, reverseOrder));
|
17414
17416
|
|
17415
17417
|
function comparator(o1, o2) {
|
17416
17418
|
for (var i = 0; i < sortPredicate.length; i++) {
|
@@ -18472,9 +18474,14 @@ var inputType = {
|
|
18472
18474
|
* minlength.
|
18473
18475
|
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
|
18474
18476
|
* maxlength.
|
18475
|
-
* @param {string=}
|
18476
|
-
*
|
18477
|
-
*
|
18477
|
+
* @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
|
18478
|
+
* that contains the regular expression body that will be converted to a regular expression
|
18479
|
+
* as in the ngPattern directive.
|
18480
|
+
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
|
18481
|
+
* a RegExp found by evaluating the Angular expression given in the attribute value.
|
18482
|
+
* If the expression evaluates to a RegExp object then this is used directly.
|
18483
|
+
* If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`
|
18484
|
+
* characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`.
|
18478
18485
|
* @param {string=} ngChange Angular expression to be executed when input changes due to user
|
18479
18486
|
* interaction with the input element.
|
18480
18487
|
* @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.
|
@@ -19015,9 +19022,14 @@ var inputType = {
|
|
19015
19022
|
* minlength.
|
19016
19023
|
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
|
19017
19024
|
* maxlength.
|
19018
|
-
* @param {string=}
|
19019
|
-
*
|
19020
|
-
*
|
19025
|
+
* @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
|
19026
|
+
* that contains the regular expression body that will be converted to a regular expression
|
19027
|
+
* as in the ngPattern directive.
|
19028
|
+
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
|
19029
|
+
* a RegExp found by evaluating the Angular expression given in the attribute value.
|
19030
|
+
* If the expression evaluates to a RegExp object then this is used directly.
|
19031
|
+
* If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`
|
19032
|
+
* characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`.
|
19021
19033
|
* @param {string=} ngChange Angular expression to be executed when input changes due to user
|
19022
19034
|
* interaction with the input element.
|
19023
19035
|
*
|
@@ -19097,9 +19109,14 @@ var inputType = {
|
|
19097
19109
|
* minlength.
|
19098
19110
|
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
|
19099
19111
|
* maxlength.
|
19100
|
-
* @param {string=}
|
19101
|
-
*
|
19102
|
-
*
|
19112
|
+
* @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
|
19113
|
+
* that contains the regular expression body that will be converted to a regular expression
|
19114
|
+
* as in the ngPattern directive.
|
19115
|
+
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
|
19116
|
+
* a RegExp found by evaluating the Angular expression given in the attribute value.
|
19117
|
+
* If the expression evaluates to a RegExp object then this is used directly.
|
19118
|
+
* If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`
|
19119
|
+
* characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`.
|
19103
19120
|
* @param {string=} ngChange Angular expression to be executed when input changes due to user
|
19104
19121
|
* interaction with the input element.
|
19105
19122
|
*
|
@@ -19180,9 +19197,14 @@ var inputType = {
|
|
19180
19197
|
* minlength.
|
19181
19198
|
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
|
19182
19199
|
* maxlength.
|
19183
|
-
* @param {string=}
|
19184
|
-
*
|
19185
|
-
*
|
19200
|
+
* @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
|
19201
|
+
* that contains the regular expression body that will be converted to a regular expression
|
19202
|
+
* as in the ngPattern directive.
|
19203
|
+
* @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
|
19204
|
+
* a RegExp found by evaluating the Angular expression given in the attribute value.
|
19205
|
+
* If the expression evaluates to a RegExp object then this is used directly.
|
19206
|
+
* If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$`
|
19207
|
+
* characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`.
|
19186
19208
|
* @param {string=} ngChange Angular expression to be executed when input changes due to user
|
19187
19209
|
* interaction with the input element.
|
19188
19210
|
*
|
@@ -19493,8 +19515,8 @@ function createDateParser(regexp, mapping) {
|
|
19493
19515
|
// When a date is JSON'ified to wraps itself inside of an extra
|
19494
19516
|
// set of double quotes. This makes the date parsing code unable
|
19495
19517
|
// to match the date string and parse it as a date.
|
19496
|
-
if (iso.charAt(0) == '"' && iso.charAt(iso.length-1) == '"') {
|
19497
|
-
iso = iso.substring(1, iso.length-1);
|
19518
|
+
if (iso.charAt(0) == '"' && iso.charAt(iso.length - 1) == '"') {
|
19519
|
+
iso = iso.substring(1, iso.length - 1);
|
19498
19520
|
}
|
19499
19521
|
if (ISO_DATE_REGEXP.test(iso)) {
|
19500
19522
|
return new Date(iso);
|
@@ -19941,12 +19963,17 @@ var VALID_CLASS = 'ng-valid',
|
|
19941
19963
|
* @property {string} $viewValue Actual string value in the view.
|
19942
19964
|
* @property {*} $modelValue The value in the model that the control is bound to.
|
19943
19965
|
* @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever
|
19944
|
-
the control reads value from the DOM. The functions are called in array order, each passing
|
19945
|
-
through to the next. The last return value is forwarded to the
|
19946
|
-
|
19947
|
-
|
19948
|
-
|
19949
|
-
|
19966
|
+
the control reads value from the DOM. The functions are called in array order, each passing
|
19967
|
+
its return value through to the next. The last return value is forwarded to the
|
19968
|
+
{@link ngModel.NgModelController#$validators `$validators`} collection.
|
19969
|
+
|
19970
|
+
Parsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue
|
19971
|
+
`$viewValue`}.
|
19972
|
+
|
19973
|
+
Returning `undefined` from a parser means a parse error occurred. In that case,
|
19974
|
+
no {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel`
|
19975
|
+
will be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`}
|
19976
|
+
is set to `true`. The parse error is stored in `ngModel.$error.parse`.
|
19950
19977
|
|
19951
19978
|
*
|
19952
19979
|
* @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever
|
@@ -20071,7 +20098,7 @@ var VALID_CLASS = 'ng-valid',
|
|
20071
20098
|
|
20072
20099
|
// Listen for change events to enable binding
|
20073
20100
|
element.on('blur keyup change', function() {
|
20074
|
-
scope.$
|
20101
|
+
scope.$evalAsync(read);
|
20075
20102
|
});
|
20076
20103
|
read(); // initialize
|
20077
20104
|
|
@@ -21007,7 +21034,7 @@ var patternDirective = function() {
|
|
21007
21034
|
var regexp, patternExp = attr.ngPattern || attr.pattern;
|
21008
21035
|
attr.$observe('pattern', function(regex) {
|
21009
21036
|
if (isString(regex) && regex.length > 0) {
|
21010
|
-
regex = new RegExp(regex);
|
21037
|
+
regex = new RegExp('^' + regex + '$');
|
21011
21038
|
}
|
21012
21039
|
|
21013
21040
|
if (regex && !regex.test) {
|
@@ -21298,7 +21325,7 @@ var ngValueDirective = function() {
|
|
21298
21325
|
* `ngModelOptions` has an effect on the element it's declared on and its descendants.
|
21299
21326
|
*
|
21300
21327
|
* @param {Object} ngModelOptions options to apply to the current model. Valid keys are:
|
21301
|
-
* - `updateOn`: string specifying which event should
|
21328
|
+
* - `updateOn`: string specifying which event should the input be bound to. You can set several
|
21302
21329
|
* events using an space delimited list. There is a special event called `default` that
|
21303
21330
|
* matches the default events belonging of the control.
|
21304
21331
|
* - `debounce`: integer value which contains the debounce model update value in milliseconds. A
|
@@ -24166,7 +24193,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
|
|
24166
24193
|
});
|
24167
24194
|
throw ngRepeatMinErr('dupes',
|
24168
24195
|
"Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",
|
24169
|
-
expression, trackById,
|
24196
|
+
expression, trackById, value);
|
24170
24197
|
} else {
|
24171
24198
|
// new never before seen block
|
24172
24199
|
nextBlockOrder[index] = {id: trackById, scope: undefined, clone: undefined};
|
@@ -24972,7 +24999,7 @@ var ngOptionsMinErr = minErr('ngOptions');
|
|
24972
24999
|
* In many cases, `ngRepeat` can be used on `<option>` elements instead of `ngOptions` to achieve a
|
24973
25000
|
* similar result. However, the `ngOptions` provides some benefits such as reducing memory and
|
24974
25001
|
* increasing speed by not creating a new scope for each repeated instance, as well as providing
|
24975
|
-
* more flexibility in how the `select`'s model is assigned via `select as`. `ngOptions should be
|
25002
|
+
* more flexibility in how the `select`'s model is assigned via `select as`. `ngOptions` should be
|
24976
25003
|
* used when the `select` model needs to be bound to a non-string value. This is because an option
|
24977
25004
|
* element can only be bound to string values at present.
|
24978
25005
|
*
|
@@ -25570,13 +25597,14 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|
25570
25597
|
lastElement = null; // start at the beginning
|
25571
25598
|
for (index = 0, length = optionGroup.length; index < length; index++) {
|
25572
25599
|
option = optionGroup[index];
|
25573
|
-
if ((existingOption = existingOptions[index+1])) {
|
25600
|
+
if ((existingOption = existingOptions[index + 1])) {
|
25574
25601
|
// reuse elements
|
25575
25602
|
lastElement = existingOption.element;
|
25576
25603
|
if (existingOption.label !== option.label) {
|
25577
25604
|
updateLabelMap(labelMap, existingOption.label, false);
|
25578
25605
|
updateLabelMap(labelMap, option.label, true);
|
25579
25606
|
lastElement.text(existingOption.label = option.label);
|
25607
|
+
lastElement.prop('label', existingOption.label);
|
25580
25608
|
}
|
25581
25609
|
if (existingOption.id !== option.id) {
|
25582
25610
|
lastElement.val(existingOption.id = option.id);
|
@@ -25606,6 +25634,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|
25606
25634
|
.val(option.id)
|
25607
25635
|
.prop('selected', option.selected)
|
25608
25636
|
.attr('selected', option.selected)
|
25637
|
+
.prop('label', option.label)
|
25609
25638
|
.text(option.label);
|
25610
25639
|
}
|
25611
25640
|
|