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