Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 93bfc67

Browse files
author
Michel Boudreau
committed
Merge remote-tracking branch 'upstream/master'
2 parents 3fde523 + 2ece1c9 commit 93bfc67

10 files changed

+113
-78
lines changed

docs/content/error/filter/notarray.ngdoc

+45-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,49 @@
33
@fullName Not an array
44
@description
55

6-
This error occurs when {@link ng.filter filter} is not used with an array.
6+
This error occurs when {@link ng.filter filter} is not used with an array:
7+
```html
8+
<input ng-model="search">
9+
<div ng-repeat="(key, value) in myObj | filter:search">
10+
{{ key }} : {{ value }}
11+
</div>
12+
```
13+
714
Filter must be used with an array so a subset of items can be returned.
8-
The array can be initialized asynchronously so null or undefined won't throw this error.
15+
The array can be initialized asynchronously and therefore null or undefined won't throw this error.
16+
17+
To filter an object by the value of its properties you can create your own custom filter:
18+
```js
19+
angular.module('customFilter',[])
20+
.filter('custom', function() {
21+
return function(input, search) {
22+
if (!input) return input;
23+
if (!search) return input;
24+
var expected = ('' + search).toLowerCase();
25+
var result = {};
26+
angular.forEach(input, function(value, key) {
27+
var actual = ('' + value).toLowerCase();
28+
if (actual.indexOf(expected) !== -1) {
29+
result[key] = value;
30+
}
31+
});
32+
return result;
33+
}
34+
});
35+
```
36+
That can be used as:
37+
```html
38+
<input ng-model="search">
39+
<div ng-repeat="(key, value) in myObj | custom:search">
40+
{{ key }} : {{ value }}
41+
</div>
42+
```
43+
44+
You could as well convert the object to an array using a filter such as
45+
[toArrayFilter](https://github.com/petebacondarwin/angular-toArrayFilter):
46+
```html
47+
<input ng-model="search">
48+
<div ng-repeat="item in myObj | toArray:false | filter:search">
49+
{{ item }}
50+
</div>
51+
```

docs/content/guide/$location.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ encoded.
165165

166166
`$location` service has two configuration modes which control the format of the URL in the browser
167167
address bar: **Hashbang mode** (the default) and the **HTML5 mode** which is based on using the
168-
HTML5 [History API](http://www.w3.org/TR/html5/introduction.html#history-0). Applications use the same API in
168+
[HTML5 History API](https://html.spec.whatwg.org/multipage/browsers.html#the-history-interface). Applications use the same API in
169169
both modes and the `$location` service will work with appropriate URL segments and browser APIs to
170170
facilitate the browser URL change and history management.
171171

i18n/closure/datetimeSymbols.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -2912,16 +2912,12 @@ goog.i18n.DateTimeSymbols_my = {
29122912
'ဇွန်', 'ဇူလိုင်', 'ဩဂုတ်',
29132913
'စက်တင်ဘာ', 'အောက်တိုဘာ',
29142914
'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'],
2915-
SHORTMONTHS: ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ',
2916-
'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်',
2917-
'ဇူလိုင်', 'ဩဂုတ်', 'စက်တင်ဘာ',
2918-
'အောက်တိုဘာ', 'နိုဝင်ဘာ',
2919-
'ဒီဇင်ဘာ'],
2920-
STANDALONESHORTMONTHS: ['ဇန်နဝါရီ',
2921-
'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ',
2922-
'ဇွန်', 'ဇူလိုင်', 'ဩဂုတ်',
2923-
'စက်တင်ဘာ', 'အောက်တိုဘာ',
2924-
'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'],
2915+
SHORTMONTHS: ['ဇန်', 'ဖေ', 'မတ်', 'ဧပြီ', 'မေ',
2916+
'ဇွန်', 'ဇူ', 'ဩ', 'စက်', 'အောက်',
2917+
'နို', 'ဒီ'],
2918+
STANDALONESHORTMONTHS: ['ဇန်', 'ဖေ', 'မတ်', 'ဧပြီ',
2919+
'မေ', 'ဇွန်', 'ဇူ', 'ဩ', 'စက်', 'အောက်',
2920+
'နို', 'ဒီ'],
29252921
WEEKDAYS: ['တနင်္ဂနွေ', 'တနင်္လာ',
29262922
'အင်္ဂါ', 'ဗုဒ္ဓဟူး',
29272923
'ကြာသပတေး', 'သောကြာ', 'စနေ'],
@@ -2945,7 +2941,7 @@ goog.i18n.DateTimeSymbols_my = {
29452941
'တတိယ သုံးလပတ်',
29462942
'စတုတ္ထ သုံးလပတ်'],
29472943
AMPMS: ['နံနက်', 'ညနေ'],
2948-
DATEFORMATS: ['EEEE, y MMMM dd', 'y MMMM d', 'y MMM d', 'yy/MM/dd'],
2944+
DATEFORMATS: ['EEEE, dd MMMM y', 'd MMMM y', 'd MMM y', 'dd-MM-yy'],
29492945
TIMEFORMATS: ['HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm'],
29502946
DATETIMEFORMATS: ['{1}မှာ {0}', '{1} {0}', '{1} {0}', '{1} {0}'],
29512947
FIRSTDAYOFWEEK: 6,

i18n/closure/datetimeSymbolsExt.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -14493,16 +14493,12 @@ goog.i18n.DateTimeSymbols_my_MM = {
1449314493
'ဇွန်', 'ဇူလိုင်', 'ဩဂုတ်',
1449414494
'စက်တင်ဘာ', 'အောက်တိုဘာ',
1449514495
'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'],
14496-
SHORTMONTHS: ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ',
14497-
'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်',
14498-
'ဇူလိုင်', 'ဩဂုတ်', 'စက်တင်ဘာ',
14499-
'အောက်တိုဘာ', 'နိုဝင်ဘာ',
14500-
'ဒီဇင်ဘာ'],
14501-
STANDALONESHORTMONTHS: ['ဇန်နဝါရီ',
14502-
'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ',
14503-
'ဇွန်', 'ဇူလိုင်', 'ဩဂုတ်',
14504-
'စက်တင်ဘာ', 'အောက်တိုဘာ',
14505-
'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'],
14496+
SHORTMONTHS: ['ဇန်', 'ဖေ', 'မတ်', 'ဧပြီ', 'မေ',
14497+
'ဇွန်', 'ဇူ', 'ဩ', 'စက်', 'အောက်',
14498+
'နို', 'ဒီ'],
14499+
STANDALONESHORTMONTHS: ['ဇန်', 'ဖေ', 'မတ်', 'ဧပြီ',
14500+
'မေ', 'ဇွန်', 'ဇူ', 'ဩ', 'စက်', 'အောက်',
14501+
'နို', 'ဒီ'],
1450614502
WEEKDAYS: ['တနင်္ဂနွေ', 'တနင်္လာ',
1450714503
'အင်္ဂါ', 'ဗုဒ္ဓဟူး',
1450814504
'ကြာသပတေး', 'သောကြာ', 'စနေ'],
@@ -14526,7 +14522,7 @@ goog.i18n.DateTimeSymbols_my_MM = {
1452614522
'တတိယ သုံးလပတ်',
1452714523
'စတုတ္ထ သုံးလပတ်'],
1452814524
AMPMS: ['နံနက်', 'ညနေ'],
14529-
DATEFORMATS: ['EEEE, y MMMM dd', 'y MMMM d', 'y MMM d', 'yy/MM/dd'],
14525+
DATEFORMATS: ['EEEE, dd MMMM y', 'd MMMM y', 'd MMM y', 'dd-MM-yy'],
1453014526
TIMEFORMATS: ['HH:mm:ss zzzz', 'HH:mm:ss z', 'HH:mm:ss', 'HH:mm'],
1453114527
DATETIMEFORMATS: ['{1}မှာ {0}', '{1} {0}', '{1} {0}', '{1} {0}'],
1453214528
FIRSTDAYOFWEEK: 6,

i18n/closure/numberSymbols.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,7 @@ goog.i18n.NumberFormatSymbols_lt = {
21122112
SCIENTIFIC_PATTERN: '#E0',
21132113
PERCENT_PATTERN: '#,##0\u00A0%',
21142114
CURRENCY_PATTERN: '#,##0.00\u00A0\u00A4',
2115-
DEF_CURRENCY_CODE: 'LTL'
2115+
DEF_CURRENCY_CODE: 'EUR'
21162116
};
21172117

21182118

src/ng/interpolate.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,28 @@ function $InterpolateProvider() {
8888
return '\\\\\\' + ch;
8989
}
9090

91+
function unescapeText(text) {
92+
return text.replace(escapedStartRegexp, startSymbol).
93+
replace(escapedEndRegexp, endSymbol);
94+
}
95+
96+
function stringify(value) {
97+
if (value == null) { // null || undefined
98+
return '';
99+
}
100+
switch (typeof value) {
101+
case 'string':
102+
break;
103+
case 'number':
104+
value = '' + value;
105+
break;
106+
default:
107+
value = toJson(value);
108+
}
109+
110+
return value;
111+
}
112+
91113
/**
92114
* @ngdoc service
93115
* @name $interpolate
@@ -243,23 +265,6 @@ function $InterpolateProvider() {
243265
$sce.valueOf(value);
244266
};
245267

246-
var stringify = function(value) {
247-
if (value == null) { // null || undefined
248-
return '';
249-
}
250-
switch (typeof value) {
251-
case 'string':
252-
break;
253-
case 'number':
254-
value = '' + value;
255-
break;
256-
default:
257-
value = toJson(value);
258-
}
259-
260-
return value;
261-
};
262-
263268
return extend(function interpolationFn(context) {
264269
var i = 0;
265270
var ii = expressions.length;
@@ -294,11 +299,6 @@ function $InterpolateProvider() {
294299
});
295300
}
296301

297-
function unescapeText(text) {
298-
return text.replace(escapedStartRegexp, startSymbol).
299-
replace(escapedEndRegexp, endSymbol);
300-
}
301-
302302
function parseStringifyInterceptor(value) {
303303
try {
304304
value = getValue(value);

src/ngLocale/angular-locale_lt-lt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ $provide.value("$locale", {
8181
"shortTime": "HH:mm"
8282
},
8383
"NUMBER_FORMATS": {
84-
"CURRENCY_SYM": "Lt",
84+
"CURRENCY_SYM": "\u20ac",
8585
"DECIMAL_SEP": ",",
8686
"GROUP_SEP": "\u00a0",
8787
"PATTERNS": [

src/ngLocale/angular-locale_lt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ $provide.value("$locale", {
8181
"shortTime": "HH:mm"
8282
},
8383
"NUMBER_FORMATS": {
84-
"CURRENCY_SYM": "Lt",
84+
"CURRENCY_SYM": "\u20ac",
8585
"DECIMAL_SEP": ",",
8686
"GROUP_SEP": "\u00a0",
8787
"PATTERNS": [

src/ngLocale/angular-locale_my-mm.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,26 @@ $provide.value("$locale", {
4040
"\u1005\u1014\u1031"
4141
],
4242
"SHORTMONTH": [
43-
"\u1007\u1014\u103a\u1014\u101d\u102b\u101b\u102e",
44-
"\u1016\u1031\u1016\u1031\u102c\u103a\u101d\u102b\u101b\u102e",
43+
"\u1007\u1014\u103a",
44+
"\u1016\u1031",
4545
"\u1019\u1010\u103a",
4646
"\u1027\u1015\u103c\u102e",
4747
"\u1019\u1031",
4848
"\u1007\u103d\u1014\u103a",
49-
"\u1007\u1030\u101c\u102d\u102f\u1004\u103a",
50-
"\u1029\u1002\u102f\u1010\u103a",
51-
"\u1005\u1000\u103a\u1010\u1004\u103a\u1018\u102c",
52-
"\u1021\u1031\u102c\u1000\u103a\u1010\u102d\u102f\u1018\u102c",
53-
"\u1014\u102d\u102f\u101d\u1004\u103a\u1018\u102c",
54-
"\u1012\u102e\u1007\u1004\u103a\u1018\u102c"
49+
"\u1007\u1030",
50+
"\u1029",
51+
"\u1005\u1000\u103a",
52+
"\u1021\u1031\u102c\u1000\u103a",
53+
"\u1014\u102d\u102f",
54+
"\u1012\u102e"
5555
],
56-
"fullDate": "EEEE, y MMMM dd",
57-
"longDate": "y MMMM d",
58-
"medium": "y MMM d HH:mm:ss",
59-
"mediumDate": "y MMM d",
56+
"fullDate": "EEEE, dd MMMM y",
57+
"longDate": "d MMMM y",
58+
"medium": "d MMM y HH:mm:ss",
59+
"mediumDate": "d MMM y",
6060
"mediumTime": "HH:mm:ss",
61-
"short": "yy/MM/dd HH:mm",
62-
"shortDate": "yy/MM/dd",
61+
"short": "dd-MM-yy HH:mm",
62+
"shortDate": "dd-MM-yy",
6363
"shortTime": "HH:mm"
6464
},
6565
"NUMBER_FORMATS": {

src/ngLocale/angular-locale_my.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,26 @@ $provide.value("$locale", {
4040
"\u1005\u1014\u1031"
4141
],
4242
"SHORTMONTH": [
43-
"\u1007\u1014\u103a\u1014\u101d\u102b\u101b\u102e",
44-
"\u1016\u1031\u1016\u1031\u102c\u103a\u101d\u102b\u101b\u102e",
43+
"\u1007\u1014\u103a",
44+
"\u1016\u1031",
4545
"\u1019\u1010\u103a",
4646
"\u1027\u1015\u103c\u102e",
4747
"\u1019\u1031",
4848
"\u1007\u103d\u1014\u103a",
49-
"\u1007\u1030\u101c\u102d\u102f\u1004\u103a",
50-
"\u1029\u1002\u102f\u1010\u103a",
51-
"\u1005\u1000\u103a\u1010\u1004\u103a\u1018\u102c",
52-
"\u1021\u1031\u102c\u1000\u103a\u1010\u102d\u102f\u1018\u102c",
53-
"\u1014\u102d\u102f\u101d\u1004\u103a\u1018\u102c",
54-
"\u1012\u102e\u1007\u1004\u103a\u1018\u102c"
49+
"\u1007\u1030",
50+
"\u1029",
51+
"\u1005\u1000\u103a",
52+
"\u1021\u1031\u102c\u1000\u103a",
53+
"\u1014\u102d\u102f",
54+
"\u1012\u102e"
5555
],
56-
"fullDate": "EEEE, y MMMM dd",
57-
"longDate": "y MMMM d",
58-
"medium": "y MMM d HH:mm:ss",
59-
"mediumDate": "y MMM d",
56+
"fullDate": "EEEE, dd MMMM y",
57+
"longDate": "d MMMM y",
58+
"medium": "d MMM y HH:mm:ss",
59+
"mediumDate": "d MMM y",
6060
"mediumTime": "HH:mm:ss",
61-
"short": "yy/MM/dd HH:mm",
62-
"shortDate": "yy/MM/dd",
61+
"short": "dd-MM-yy HH:mm",
62+
"shortDate": "dd-MM-yy",
6363
"shortTime": "HH:mm"
6464
},
6565
"NUMBER_FORMATS": {

0 commit comments

Comments
 (0)