@angular-wave/angular.ts 0.0.69 → 0.0.70
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.
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/core/compile/compile.js +0 -1
- package/src/core/compile/compile.spec.js +2 -2
- package/src/core/scope/scope.js +0 -1
- package/src/{exts → directive}/aria/aria.html +1 -1
- package/src/directive/aria/aria.js +382 -0
- package/src/{exts → directive}/aria/aria.spec.js +12 -12
- package/src/{exts → directive}/aria/aria.test.js +1 -1
- package/src/directive/messages/messages.js +267 -274
- package/src/filters/filter.js +0 -3
- package/src/filters/limit-to.js +0 -1
- package/src/public.js +27 -3
- package/src/shared/utils.js +0 -2
- package/types/core/scope/scope.d.ts +1 -2
- package/types/directive/aria/aria.d.ts +94 -0
- package/types/shared/utils.d.ts +0 -2
- package/src/exts/aria/aria.js +0 -415
- package/types/exts/aria/aria.d.ts +0 -1
- /package/src/{exts → directive}/aria/aria.md +0 -0
|
@@ -7,209 +7,203 @@ export function ngMessagesDirective($animate) {
|
|
|
7
7
|
return {
|
|
8
8
|
require: "ngMessages",
|
|
9
9
|
restrict: "AE",
|
|
10
|
-
controller:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.getAttachId = function getAttachId() {
|
|
22
|
-
return nextAttachId++;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const messages = (this.messages = {});
|
|
26
|
-
let renderLater;
|
|
27
|
-
let cachedCollection;
|
|
28
|
-
|
|
29
|
-
this.render = function (collection) {
|
|
30
|
-
collection = collection || {};
|
|
31
|
-
|
|
32
|
-
renderLater = false;
|
|
33
|
-
cachedCollection = collection;
|
|
34
|
-
|
|
35
|
-
// this is true if the attribute is empty or if the attribute value is truthy
|
|
36
|
-
const multiple =
|
|
37
|
-
isAttrTruthy($scope, $attrs.ngMessagesMultiple) ||
|
|
38
|
-
isAttrTruthy($scope, $attrs.multiple);
|
|
39
|
-
|
|
40
|
-
const unmatchedMessages = [];
|
|
41
|
-
const matchedKeys = {};
|
|
42
|
-
let truthyKeys = 0;
|
|
43
|
-
let messageItem = ctrl.head;
|
|
44
|
-
let messageFound = false;
|
|
45
|
-
let totalMessages = 0;
|
|
46
|
-
|
|
47
|
-
// we use != instead of !== to allow for both undefined and null values
|
|
48
|
-
while (messageItem != null) {
|
|
49
|
-
totalMessages++;
|
|
50
|
-
const messageCtrl = messageItem.message;
|
|
51
|
-
|
|
52
|
-
let messageUsed = false;
|
|
53
|
-
if (!messageFound) {
|
|
54
|
-
forEach(collection, (value, key) => {
|
|
55
|
-
if (truthy(value) && !messageUsed) {
|
|
56
|
-
truthyKeys++;
|
|
57
|
-
|
|
58
|
-
if (messageCtrl.test(key)) {
|
|
59
|
-
// this is to prevent the same error name from showing up twice
|
|
60
|
-
if (matchedKeys[key]) return;
|
|
61
|
-
matchedKeys[key] = true;
|
|
62
|
-
|
|
63
|
-
messageUsed = true;
|
|
64
|
-
messageCtrl.attach();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
10
|
+
controller: function ($element, $scope, $attrs) {
|
|
11
|
+
const ctrl = this;
|
|
12
|
+
let latestKey = 0;
|
|
13
|
+
let nextAttachId = 0;
|
|
14
|
+
this.head = undefined;
|
|
15
|
+
this.default = undefined;
|
|
16
|
+
|
|
17
|
+
this.getAttachId = function getAttachId() {
|
|
18
|
+
return nextAttachId++;
|
|
19
|
+
};
|
|
69
20
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
21
|
+
const messages = (this.messages = {});
|
|
22
|
+
let renderLater;
|
|
23
|
+
let cachedCollection;
|
|
24
|
+
|
|
25
|
+
this.render = function (collection) {
|
|
26
|
+
collection = collection || {};
|
|
27
|
+
|
|
28
|
+
renderLater = false;
|
|
29
|
+
cachedCollection = collection;
|
|
30
|
+
|
|
31
|
+
// this is true if the attribute is empty or if the attribute value is truthy
|
|
32
|
+
const multiple =
|
|
33
|
+
isAttrTruthy($scope, $attrs.ngMessagesMultiple) ||
|
|
34
|
+
isAttrTruthy($scope, $attrs.multiple);
|
|
35
|
+
|
|
36
|
+
const unmatchedMessages = [];
|
|
37
|
+
const matchedKeys = {};
|
|
38
|
+
let truthyKeys = 0;
|
|
39
|
+
let messageItem = ctrl.head;
|
|
40
|
+
let messageFound = false;
|
|
41
|
+
let totalMessages = 0;
|
|
42
|
+
|
|
43
|
+
// we use != instead of !== to allow for both undefined and null values
|
|
44
|
+
while (messageItem != null) {
|
|
45
|
+
totalMessages++;
|
|
46
|
+
const messageCtrl = messageItem.message;
|
|
47
|
+
|
|
48
|
+
let messageUsed = false;
|
|
49
|
+
if (!messageFound) {
|
|
50
|
+
forEach(collection, (value, key) => {
|
|
51
|
+
if (truthy(value) && !messageUsed) {
|
|
52
|
+
truthyKeys++;
|
|
53
|
+
|
|
54
|
+
if (messageCtrl.test(key)) {
|
|
55
|
+
// this is to prevent the same error name from showing up twice
|
|
56
|
+
if (matchedKeys[key]) return;
|
|
57
|
+
matchedKeys[key] = true;
|
|
58
|
+
|
|
59
|
+
messageUsed = true;
|
|
60
|
+
messageCtrl.attach();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
77
65
|
|
|
78
|
-
|
|
66
|
+
if (messageUsed) {
|
|
67
|
+
// unless we want to display multiple messages then we should
|
|
68
|
+
// set a flag here to avoid displaying the next message in the list
|
|
69
|
+
messageFound = !multiple;
|
|
70
|
+
} else {
|
|
71
|
+
unmatchedMessages.push(messageCtrl);
|
|
79
72
|
}
|
|
80
73
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
});
|
|
74
|
+
messageItem = messageItem.next;
|
|
75
|
+
}
|
|
84
76
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
forEach(unmatchedMessages, (messageCtrl) => {
|
|
78
|
+
messageCtrl.detach();
|
|
79
|
+
});
|
|
88
80
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
} else if (ctrl.default) {
|
|
92
|
-
ctrl.default.detach();
|
|
93
|
-
}
|
|
81
|
+
const messageMatched = unmatchedMessages.length !== totalMessages;
|
|
82
|
+
const attachDefault = ctrl.default && !messageMatched && truthyKeys > 0;
|
|
94
83
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
};
|
|
84
|
+
if (attachDefault) {
|
|
85
|
+
ctrl.default.attach();
|
|
86
|
+
} else if (ctrl.default) {
|
|
87
|
+
ctrl.default.detach();
|
|
88
|
+
}
|
|
101
89
|
|
|
102
|
-
|
|
90
|
+
if (messageMatched || attachDefault) {
|
|
91
|
+
$animate.setClass($element, ACTIVE_CLASS, INACTIVE_CLASS);
|
|
92
|
+
} else {
|
|
93
|
+
$animate.setClass($element, INACTIVE_CLASS, ACTIVE_CLASS);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
103
96
|
|
|
104
|
-
|
|
105
|
-
if (!renderLater) {
|
|
106
|
-
renderLater = true;
|
|
107
|
-
$scope.$evalAsync(() => {
|
|
108
|
-
if (renderLater && cachedCollection) {
|
|
109
|
-
ctrl.render(cachedCollection);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
};
|
|
97
|
+
$scope.$watchCollection($attrs.ngMessages || $attrs.for, ctrl.render);
|
|
114
98
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
latestKey++;
|
|
126
|
-
}
|
|
99
|
+
this.reRender = function () {
|
|
100
|
+
if (!renderLater) {
|
|
101
|
+
renderLater = true;
|
|
102
|
+
$scope.$evalAsync(() => {
|
|
103
|
+
if (renderLater && cachedCollection) {
|
|
104
|
+
ctrl.render(cachedCollection);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
127
109
|
|
|
128
|
-
|
|
129
|
-
|
|
110
|
+
this.register = function (comment, messageCtrl, isDefault) {
|
|
111
|
+
if (isDefault) {
|
|
112
|
+
ctrl.default = messageCtrl;
|
|
113
|
+
} else {
|
|
114
|
+
const nextKey = latestKey.toString();
|
|
115
|
+
messages[nextKey] = {
|
|
116
|
+
message: messageCtrl,
|
|
117
|
+
};
|
|
118
|
+
insertMessageNode($element[0], comment, nextKey);
|
|
119
|
+
comment.$$ngMessageNode = nextKey;
|
|
120
|
+
latestKey++;
|
|
121
|
+
}
|
|
130
122
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
delete ctrl.default;
|
|
134
|
-
} else {
|
|
135
|
-
const key = comment.$$ngMessageNode;
|
|
136
|
-
delete comment.$$ngMessageNode;
|
|
137
|
-
removeMessageNode($element[0], comment, key);
|
|
138
|
-
delete messages[key];
|
|
139
|
-
}
|
|
140
|
-
ctrl.reRender();
|
|
141
|
-
};
|
|
123
|
+
ctrl.reRender();
|
|
124
|
+
};
|
|
142
125
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
126
|
+
this.deregister = function (comment, isDefault) {
|
|
127
|
+
if (isDefault) {
|
|
128
|
+
delete ctrl.default;
|
|
129
|
+
} else {
|
|
130
|
+
const key = comment.$$ngMessageNode;
|
|
131
|
+
delete comment.$$ngMessageNode;
|
|
132
|
+
removeMessageNode($element[0], comment, key);
|
|
133
|
+
delete messages[key];
|
|
134
|
+
}
|
|
135
|
+
ctrl.reRender();
|
|
136
|
+
};
|
|
146
137
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
return messages[prevKey];
|
|
151
|
-
}
|
|
138
|
+
function findPreviousMessage(parent, comment) {
|
|
139
|
+
let prevNode = comment;
|
|
140
|
+
const parentLookup = [];
|
|
152
141
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
parentLookup.indexOf(prevNode) === -1
|
|
158
|
-
) {
|
|
159
|
-
parentLookup.push(prevNode);
|
|
160
|
-
prevNode = prevNode.childNodes[prevNode.childNodes.length - 1];
|
|
161
|
-
} else if (prevNode.previousSibling) {
|
|
162
|
-
prevNode = prevNode.previousSibling;
|
|
163
|
-
} else {
|
|
164
|
-
prevNode = prevNode.parentNode;
|
|
165
|
-
parentLookup.push(prevNode);
|
|
166
|
-
}
|
|
142
|
+
while (prevNode && prevNode !== parent) {
|
|
143
|
+
const prevKey = prevNode.$$ngMessageNode;
|
|
144
|
+
if (prevKey && prevKey.length) {
|
|
145
|
+
return messages[prevKey];
|
|
167
146
|
}
|
|
168
|
-
}
|
|
169
147
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (
|
|
173
|
-
|
|
148
|
+
// dive deeper into the DOM and examine its children for any ngMessage
|
|
149
|
+
// comments that may be in an element that appears deeper in the list
|
|
150
|
+
if (
|
|
151
|
+
prevNode.childNodes.length &&
|
|
152
|
+
parentLookup.indexOf(prevNode) === -1
|
|
153
|
+
) {
|
|
154
|
+
parentLookup.push(prevNode);
|
|
155
|
+
prevNode = prevNode.childNodes[prevNode.childNodes.length - 1];
|
|
156
|
+
} else if (prevNode.previousSibling) {
|
|
157
|
+
prevNode = prevNode.previousSibling;
|
|
174
158
|
} else {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
messageNode.next = match.next;
|
|
178
|
-
match.next = messageNode;
|
|
179
|
-
} else {
|
|
180
|
-
messageNode.next = ctrl.head;
|
|
181
|
-
ctrl.head = messageNode;
|
|
182
|
-
}
|
|
159
|
+
prevNode = prevNode.parentNode;
|
|
160
|
+
parentLookup.push(prevNode);
|
|
183
161
|
}
|
|
184
162
|
}
|
|
163
|
+
}
|
|
185
164
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
165
|
+
function insertMessageNode(parent, comment, key) {
|
|
166
|
+
const messageNode = messages[key];
|
|
167
|
+
if (!ctrl.head) {
|
|
168
|
+
ctrl.head = messageNode;
|
|
169
|
+
} else {
|
|
192
170
|
const match = findPreviousMessage(parent, comment);
|
|
193
171
|
if (match) {
|
|
194
|
-
|
|
172
|
+
messageNode.next = match.next;
|
|
173
|
+
match.next = messageNode;
|
|
195
174
|
} else {
|
|
196
|
-
|
|
175
|
+
messageNode.next = ctrl.head;
|
|
176
|
+
ctrl.head = messageNode;
|
|
197
177
|
}
|
|
198
178
|
}
|
|
199
|
-
}
|
|
200
|
-
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function removeMessageNode(parent, comment, key) {
|
|
182
|
+
const messageNode = messages[key];
|
|
183
|
+
|
|
184
|
+
// This message node may have already been removed by a call to deregister()
|
|
185
|
+
if (!messageNode) return;
|
|
186
|
+
|
|
187
|
+
const match = findPreviousMessage(parent, comment);
|
|
188
|
+
if (match) {
|
|
189
|
+
match.next = messageNode.next;
|
|
190
|
+
} else {
|
|
191
|
+
ctrl.head = messageNode.next;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
201
195
|
};
|
|
196
|
+
}
|
|
202
197
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
198
|
+
function isAttrTruthy(scope, attr) {
|
|
199
|
+
return (
|
|
200
|
+
(isString(attr) && attr.length === 0) || // empty attribute
|
|
201
|
+
truthy(scope.$eval(attr))
|
|
202
|
+
);
|
|
203
|
+
}
|
|
209
204
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
205
|
+
function truthy(val) {
|
|
206
|
+
return isString(val) ? val.length : !!val;
|
|
213
207
|
}
|
|
214
208
|
|
|
215
209
|
ngMessagesIncludeDirective.$inject = ["$templateRequest", "$compile"];
|
|
@@ -239,108 +233,107 @@ export const ngMessageExpDirective = ngMessageDirectiveFactory(false);
|
|
|
239
233
|
export const ngMessageDefaultDirective = ngMessageDirectiveFactory(true);
|
|
240
234
|
|
|
241
235
|
function ngMessageDirectiveFactory(isDefault) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
?
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
assignRecords(staticExp);
|
|
276
|
-
}
|
|
236
|
+
ngMessageDirective.$inject = ["$animate"];
|
|
237
|
+
function ngMessageDirective($animate) {
|
|
238
|
+
return {
|
|
239
|
+
restrict: "AE",
|
|
240
|
+
transclude: "element",
|
|
241
|
+
priority: 1, // must run before ngBind, otherwise the text is set on the comment
|
|
242
|
+
terminal: true,
|
|
243
|
+
require: "^^ngMessages",
|
|
244
|
+
link(scope, element, attrs, ngMessagesCtrl, $transclude) {
|
|
245
|
+
let commentNode;
|
|
246
|
+
let records;
|
|
247
|
+
let staticExp;
|
|
248
|
+
let dynamicExp;
|
|
249
|
+
|
|
250
|
+
if (!isDefault) {
|
|
251
|
+
commentNode = element[0];
|
|
252
|
+
staticExp = attrs.ngMessage || attrs.when;
|
|
253
|
+
dynamicExp = attrs.ngMessageExp || attrs.whenExp;
|
|
254
|
+
|
|
255
|
+
const assignRecords = function (items) {
|
|
256
|
+
records = items
|
|
257
|
+
? Array.isArray(items)
|
|
258
|
+
? items
|
|
259
|
+
: items.split(/[\s,]+/)
|
|
260
|
+
: null;
|
|
261
|
+
ngMessagesCtrl.reRender();
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
if (dynamicExp) {
|
|
265
|
+
assignRecords(scope.$eval(dynamicExp));
|
|
266
|
+
scope.$watchCollection(dynamicExp, assignRecords);
|
|
267
|
+
} else {
|
|
268
|
+
assignRecords(staticExp);
|
|
277
269
|
}
|
|
270
|
+
}
|
|
278
271
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
});
|
|
272
|
+
let currentElement;
|
|
273
|
+
let messageCtrl;
|
|
274
|
+
ngMessagesCtrl.register(
|
|
275
|
+
commentNode,
|
|
276
|
+
(messageCtrl = {
|
|
277
|
+
test(name) {
|
|
278
|
+
return contains(records, name);
|
|
279
|
+
},
|
|
280
|
+
attach() {
|
|
281
|
+
if (!currentElement) {
|
|
282
|
+
$transclude((elm, newScope) => {
|
|
283
|
+
$animate.enter(elm, null, element);
|
|
284
|
+
currentElement = elm;
|
|
285
|
+
|
|
286
|
+
// Each time we attach this node to a message we get a new id that we can match
|
|
287
|
+
// when we are destroying the node later.
|
|
288
|
+
const $$attachId = (currentElement.$$attachId =
|
|
289
|
+
ngMessagesCtrl.getAttachId());
|
|
290
|
+
|
|
291
|
+
// in the event that the element or a parent element is destroyed
|
|
292
|
+
// by another structural directive then it's time
|
|
293
|
+
// to deregister the message from the controller
|
|
294
|
+
currentElement.on("$destroy", () => {
|
|
295
|
+
// If the message element was removed via a call to `detach` then `currentElement` will be null
|
|
296
|
+
// So this handler only handles cases where something else removed the message element.
|
|
297
|
+
if (
|
|
298
|
+
currentElement &&
|
|
299
|
+
currentElement.$$attachId === $$attachId
|
|
300
|
+
) {
|
|
301
|
+
ngMessagesCtrl.deregister(commentNode, isDefault);
|
|
302
|
+
messageCtrl.detach();
|
|
303
|
+
}
|
|
304
|
+
newScope.$destroy();
|
|
313
305
|
});
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
detach() {
|
|
310
|
+
if (currentElement) {
|
|
311
|
+
const elm = currentElement;
|
|
312
|
+
currentElement = null;
|
|
313
|
+
$animate.leave(elm);
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
}),
|
|
317
|
+
isDefault,
|
|
318
|
+
);
|
|
319
|
+
|
|
320
|
+
// We need to ensure that this directive deregisters itself when it no longer exists
|
|
321
|
+
// Normally this is done when the attached element is destroyed; but if this directive
|
|
322
|
+
// gets removed before we attach the message to the DOM there is nothing to watch
|
|
323
|
+
// in which case we must deregister when the containing scope is destroyed.
|
|
324
|
+
scope.$on("$destroy", () => {
|
|
325
|
+
ngMessagesCtrl.deregister(commentNode, isDefault);
|
|
326
|
+
});
|
|
327
|
+
},
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
return ngMessageDirective;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function contains(collection, key) {
|
|
334
|
+
if (collection) {
|
|
335
|
+
return Array.isArray(collection)
|
|
336
|
+
? collection.indexOf(key) >= 0
|
|
337
|
+
: Object.prototype.hasOwnProperty.call(collection, key);
|
|
345
338
|
}
|
|
346
339
|
}
|
package/src/filters/filter.js
CHANGED
|
@@ -65,7 +65,6 @@ export function filterFilter() {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// Helper functions for `filterFilter`
|
|
68
|
-
/** @private */
|
|
69
68
|
function createPredicateFn(
|
|
70
69
|
expression,
|
|
71
70
|
comparator,
|
|
@@ -124,7 +123,6 @@ function createPredicateFn(
|
|
|
124
123
|
return predicateFn;
|
|
125
124
|
}
|
|
126
125
|
|
|
127
|
-
/** @private */
|
|
128
126
|
function deepCompare(
|
|
129
127
|
actual,
|
|
130
128
|
expected,
|
|
@@ -211,7 +209,6 @@ function deepCompare(
|
|
|
211
209
|
}
|
|
212
210
|
|
|
213
211
|
// Used for easily differentiating between `null` and actual `object`
|
|
214
|
-
/** @private */
|
|
215
212
|
function getTypeForFilter(val) {
|
|
216
213
|
return val === null ? "null" : typeof val;
|
|
217
214
|
}
|