@angular-wave/angular.ts 0.4.3 → 0.4.4
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.umd.js +10 -0
- package/index.html +74 -3
- package/package.json +1 -1
- package/src/angular.spec.js +0 -5
- package/src/animations/animate-css.js +5 -13
- package/src/animations/animate-queue.js +22 -21
- package/src/animations/animate-runner.js +4 -8
- package/src/animations/animate.md +1 -1
- package/src/animations/animate.spec.js +0 -21
- package/src/animations/animation.js +1 -1
- package/src/binding.spec.js +0 -1
- package/src/core/cache/cache.js +2 -29
- package/src/core/compile/compile.js +26 -27
- package/src/core/compile/compile.spec.js +17 -266
- package/src/core/compile/compile.test.js +1 -1
- package/src/core/controller/controller.js +2 -0
- package/src/core/di/injector.md +1 -1
- package/src/core/di/injector.spec.js +0 -2
- package/src/core/di/internal-injector.js +2 -1
- package/src/core/interpolate/interpolate.js +16 -3
- package/src/core/interpolate/interpolate.spec.js +70 -16
- package/src/core/interval/interval.test.js +1 -1
- package/src/core/location/location.js +0 -2
- package/src/core/location/location.spec.js +27 -27
- package/src/core/{scope/scope.html → model/model.html} +1 -1
- package/src/core/model/model.js +944 -0
- package/src/core/model/model.spec.js +3012 -0
- package/src/core/on.spec.js +0 -7
- package/src/core/parse/interpreter.js +10 -7
- package/src/core/parse/parse.js +26 -5
- package/src/core/parse/parse.spec.js +95 -91
- package/src/core/prop.spec.js +4 -60
- package/src/core/sce/sce.spec.js +0 -8
- package/src/core/scope/scope.js +61 -30
- package/src/core/scope/scope.spec.js +25 -1960
- package/src/directive/aria/aria.js +3 -6
- package/src/directive/aria/aria.spec.js +0 -87
- package/src/directive/attrs/attrs.spec.js +0 -5
- package/src/directive/attrs/boolean.spec.js +0 -15
- package/src/directive/attrs/element-style.spec.js +0 -8
- package/src/directive/attrs/src.spec.js +0 -7
- package/src/directive/bind/bind.spec.js +0 -33
- package/src/directive/bind/bing-html.spec.js +0 -3
- package/src/{core/q/q.html → directive/channel/channel.html} +1 -1
- package/src/directive/channel/channel.js +29 -0
- package/src/directive/channel/channel.spec.js +52 -0
- package/src/directive/{list/list.test.js → channel/channel.test.js} +2 -4
- package/src/directive/class/class.js +3 -3
- package/src/directive/class/class.spec.js +9 -75
- package/src/directive/controller/controller.spec.js +0 -13
- package/src/directive/events/click.spec.js +0 -3
- package/src/directive/events/event.spec.js +0 -6
- package/src/directive/form/form.js +2 -3
- package/src/directive/form/form.spec.js +0 -65
- package/src/directive/if/if.spec.js +0 -4
- package/src/directive/include/include.spec.js +8 -59
- package/src/directive/init/init.js +6 -2
- package/src/directive/init/init.spec.js +0 -2
- package/src/directive/input/input.spec.js +0 -136
- package/src/directive/messages/messages.spec.js +4 -35
- package/src/directive/model/model.js +18 -25
- package/src/directive/model/model.spec.js +2 -49
- package/src/directive/model-options/model-options.spec.js +0 -6
- package/src/directive/non-bindable/non-bindable.spec.js +0 -1
- package/src/directive/observe/observe.js +0 -1
- package/src/directive/observe/observe.spec.js +0 -1
- package/src/directive/options/options.spec.js +0 -34
- package/src/directive/ref/href.spec.js +0 -15
- package/src/directive/repeat/repeat.spec.js +8 -135
- package/src/directive/script/script.spec.js +0 -2
- package/src/directive/select/select.js +3 -3
- package/src/directive/select/select.spec.js +0 -96
- package/src/directive/show-hide/show-hide.js +2 -2
- package/src/directive/show-hide/show-hide.spec.js +8 -19
- package/src/directive/style/style.spec.js +0 -7
- package/src/directive/switch/switch.spec.js +5 -5
- package/src/directive/validators/validators.spec.js +0 -1
- package/src/loader.js +0 -1
- package/src/public.js +75 -80
- package/src/router/common/coreservices.js +0 -2
- package/src/router/directives/state-directives.js +6 -14
- package/src/router/directives/state-directives.spec.js +0 -83
- package/src/router/directives/view-directive.js +4 -13
- package/src/router/directives/view-directive.spec.js +25 -71
- package/src/router/hooks/lazy-load.js +2 -2
- package/src/router/hooks/views.js +3 -5
- package/src/router/resolve/resolvable.js +3 -6
- package/src/router/resolve/resolve-context.js +2 -2
- package/src/router/state/state-service.js +4 -4
- package/src/router/state/state.spec.js +2 -5
- package/src/router/state/views.js +7 -10
- package/src/router/template-factory.js +3 -6
- package/src/router/template-factory.spec.js +0 -4
- package/src/router/transition/transition-hook.js +1 -1
- package/src/router/transition/transition.js +1 -1
- package/src/router/view-hook.spec.js +2 -2
- package/src/router/view-scroll.js +4 -6
- package/src/services/http/http.js +6 -9
- package/src/services/http/http.spec.js +30 -31
- package/src/services/http/template-request.spec.js +0 -10
- package/src/services/http-backend/http-backend.spec.js +3 -3
- package/src/services/template-request.js +2 -4
- package/src/shared/common.js +1 -2
- package/src/shared/jqlite/jqlite.js +0 -3
- package/types/core/cache/cache.d.ts +1 -1
- package/types/core/model/model.d.ts +204 -0
- package/types/core/parse/parse.d.ts +26 -0
- package/types/core/scope/scope.d.ts +22 -21
- package/types/directive/channel/channel.d.ts +11 -0
- package/src/core/interval/interval-factory.js +0 -50
- package/src/core/interval/interval.html +0 -18
- package/src/core/interval/interval.js +0 -77
- package/src/core/interval/interval.md +0 -123
- package/src/core/interval/interval.spec.js +0 -280
- package/src/core/q/q.js +0 -472
- package/src/core/q/q.md +0 -211
- package/src/core/q/q.spec.js +0 -2748
- package/src/core/q/q.test.js +0 -12
- package/src/core/scope/scope.test.js +0 -12
- package/src/core/timeout/timeout.html +0 -18
- package/src/core/timeout/timeout.js +0 -109
- package/src/core/timeout/timeout.spec.js +0 -354
- package/src/core/timeout/timout.test.js +0 -12
- package/src/directive/list/list.html +0 -18
- package/src/directive/list/list.js +0 -46
- package/src/directive/list/list.md +0 -22
- package/src/directive/list/list.spec.js +0 -172
- package/types/directive/list/list.d.ts +0 -4
|
@@ -348,12 +348,9 @@ export function ngModelAriaDirective($aria) {
|
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
if (shouldAttachAttr("aria-invalid", "ariaInvalid", elem, true)) {
|
|
351
|
-
scope.$watch(
|
|
352
|
-
(
|
|
353
|
-
|
|
354
|
-
elem.attr("aria-invalid", (!!newVal).toString());
|
|
355
|
-
},
|
|
356
|
-
);
|
|
351
|
+
scope.$watch("ngModel.$invalid", (newVal) => {
|
|
352
|
+
elem.attr("aria-invalid", (!!newVal).toString());
|
|
353
|
+
});
|
|
357
354
|
}
|
|
358
355
|
},
|
|
359
356
|
};
|
|
@@ -38,8 +38,6 @@ describe("$aria", () => {
|
|
|
38
38
|
'<div role="radio" ng-model="val" value="one" ng-aria-disable></div>' +
|
|
39
39
|
'<div role="radio" ng-model="val" value="two" ng-aria-disable></div>',
|
|
40
40
|
)(scope);
|
|
41
|
-
scope.$digest();
|
|
42
|
-
|
|
43
41
|
const radio1 = element.eq(0);
|
|
44
42
|
const radio2 = element.eq(1);
|
|
45
43
|
|
|
@@ -57,8 +55,6 @@ describe("$aria", () => {
|
|
|
57
55
|
element = $compile('<div ng-disabled="val" ng-aria-disable></div>')(
|
|
58
56
|
scope,
|
|
59
57
|
);
|
|
60
|
-
scope.$digest();
|
|
61
|
-
|
|
62
58
|
scope.$apply("val = false");
|
|
63
59
|
expect(element[0].hasAttribute("aria-disabled")).toBeFalse();
|
|
64
60
|
|
|
@@ -69,8 +65,6 @@ describe("$aria", () => {
|
|
|
69
65
|
// ariaHidden
|
|
70
66
|
it("should not attach aria-hidden to `ngShow`", () => {
|
|
71
67
|
element = $compile('<div ng-show="val" ng-aria-disable></div>')(scope);
|
|
72
|
-
scope.$digest();
|
|
73
|
-
|
|
74
68
|
scope.$apply("val = false");
|
|
75
69
|
expect(element[0].hasAttribute("aria-hidden")).toBeFalse();
|
|
76
70
|
|
|
@@ -80,8 +74,6 @@ describe("$aria", () => {
|
|
|
80
74
|
|
|
81
75
|
it("should not attach aria-hidden to `ngHide`", () => {
|
|
82
76
|
element = $compile('<div ng-hide="val" ng-aria-disable></div>')(scope);
|
|
83
|
-
scope.$digest();
|
|
84
|
-
|
|
85
77
|
scope.$apply("val = false");
|
|
86
78
|
expect(element[0].hasAttribute("aria-hidden")).toBeFalse();
|
|
87
79
|
|
|
@@ -94,8 +86,6 @@ describe("$aria", () => {
|
|
|
94
86
|
element = $compile(
|
|
95
87
|
'<input ng-model="val" ng-minlength="10" ng-aria-disable />',
|
|
96
88
|
)(scope);
|
|
97
|
-
scope.$digest();
|
|
98
|
-
|
|
99
89
|
scope.$apply('val = "lt 10"');
|
|
100
90
|
expect(element[0].hasAttribute("aria-invalid")).toBeFalse();
|
|
101
91
|
|
|
@@ -107,8 +97,6 @@ describe("$aria", () => {
|
|
|
107
97
|
element = $compile(
|
|
108
98
|
'<div role="textbox" ng-model="val" ng-minlength="10" ng-aria-disable></div>',
|
|
109
99
|
)(scope);
|
|
110
|
-
scope.$digest();
|
|
111
|
-
|
|
112
100
|
scope.$apply('val = "lt 10"');
|
|
113
101
|
expect(element[0].hasAttribute("aria-invalid")).toBeFalse();
|
|
114
102
|
|
|
@@ -119,7 +107,6 @@ describe("$aria", () => {
|
|
|
119
107
|
// ariaLive
|
|
120
108
|
it("should not attach aria-live to `ngMessages`", () => {
|
|
121
109
|
element = $compile('<div ng-messages="val" ng-aria-disable>')(scope);
|
|
122
|
-
scope.$digest();
|
|
123
110
|
expect(element[0].hasAttribute("aria-live")).toBeFalse();
|
|
124
111
|
});
|
|
125
112
|
|
|
@@ -128,8 +115,6 @@ describe("$aria", () => {
|
|
|
128
115
|
element = $compile('<div ng-readonly="val" ng-aria-disable></div>')(
|
|
129
116
|
scope,
|
|
130
117
|
);
|
|
131
|
-
scope.$digest();
|
|
132
|
-
|
|
133
118
|
scope.$apply("val = false");
|
|
134
119
|
expect(element[0].hasAttribute("aria-readonly")).toBeFalse();
|
|
135
120
|
|
|
@@ -142,7 +127,6 @@ describe("$aria", () => {
|
|
|
142
127
|
element = $compile('<div ng-model="val" required ng-aria-disable></div>')(
|
|
143
128
|
scope,
|
|
144
129
|
);
|
|
145
|
-
scope.$digest();
|
|
146
130
|
expect(element[0].hasAttribute("aria-required")).toBeFalse();
|
|
147
131
|
});
|
|
148
132
|
|
|
@@ -150,8 +134,6 @@ describe("$aria", () => {
|
|
|
150
134
|
element = $compile(
|
|
151
135
|
'<div ng-model="val" ng-required="val" ng-aria-disable></div>',
|
|
152
136
|
)(scope);
|
|
153
|
-
scope.$digest();
|
|
154
|
-
|
|
155
137
|
scope.$apply("val = false");
|
|
156
138
|
expect(element[0].hasAttribute("aria-required")).toBeFalse();
|
|
157
139
|
|
|
@@ -164,8 +146,6 @@ describe("$aria", () => {
|
|
|
164
146
|
element = $compile(
|
|
165
147
|
'<input type="range" ng-model="val" min="0" max="100" ng-aria-disable />',
|
|
166
148
|
)(scope);
|
|
167
|
-
scope.$digest();
|
|
168
|
-
|
|
169
149
|
expect(element[0].hasAttribute("aria-valuemax")).toBeFalse();
|
|
170
150
|
expect(element[0].hasAttribute("aria-valuemin")).toBeFalse();
|
|
171
151
|
expect(element[0].hasAttribute("aria-valuenow")).toBeFalse();
|
|
@@ -186,8 +166,6 @@ describe("$aria", () => {
|
|
|
186
166
|
'<div role="progressbar" ng-model="val" min="0" max="100" ng-aria-disable></div>' +
|
|
187
167
|
'<div role="slider" ng-model="val" min="0" max="100" ng-aria-disable></div>',
|
|
188
168
|
)(scope);
|
|
189
|
-
scope.$digest();
|
|
190
|
-
|
|
191
169
|
const progressbar = element.eq(0);
|
|
192
170
|
const slider = element.eq(1);
|
|
193
171
|
|
|
@@ -216,8 +194,6 @@ describe("$aria", () => {
|
|
|
216
194
|
'<div ng-click="onClick()" tabindex="0" ng-aria-disable></div>' +
|
|
217
195
|
'<ul><li ng-click="onClick()" tabindex="0" ng-aria-disable></li></ul>',
|
|
218
196
|
)(scope);
|
|
219
|
-
scope.$digest();
|
|
220
|
-
|
|
221
197
|
const div = element.find("div");
|
|
222
198
|
const li = element.find("li");
|
|
223
199
|
|
|
@@ -235,8 +211,6 @@ describe("$aria", () => {
|
|
|
235
211
|
'<div type="radio" ng-model="val" ng-aria-disable></div>' +
|
|
236
212
|
'<div type="range" ng-model="val" ng-aria-disable></div>',
|
|
237
213
|
)(scope);
|
|
238
|
-
scope.$digest();
|
|
239
|
-
|
|
240
214
|
expect(element.eq(0)[0].hasAttribute("role")).toBeFalse();
|
|
241
215
|
expect(element.eq(1)[0].hasAttribute("role")).toBeFalse();
|
|
242
216
|
expect(element.eq(2)[0].hasAttribute("role")).toBeFalse();
|
|
@@ -249,8 +223,6 @@ describe("$aria", () => {
|
|
|
249
223
|
'<div role="checkbox" ng-model="val" ng-aria-disable></div>' +
|
|
250
224
|
'<div role="slider" ng-model="val" ng-aria-disable></div>',
|
|
251
225
|
)(scope);
|
|
252
|
-
scope.$digest();
|
|
253
|
-
|
|
254
226
|
expect(element.eq(0)[0].hasAttribute("tabindex")).toBeFalse();
|
|
255
227
|
expect(element.eq(1)[0].hasAttribute("tabindex")).toBeFalse();
|
|
256
228
|
});
|
|
@@ -260,8 +232,6 @@ describe("$aria", () => {
|
|
|
260
232
|
'<div ng-click="onClick()" ng-aria-disable></div>' +
|
|
261
233
|
'<div ng-dblclick="onDblclick()" ng-aria-disable></div>',
|
|
262
234
|
)(scope);
|
|
263
|
-
scope.$digest();
|
|
264
|
-
|
|
265
235
|
expect(element.eq(0)[0].hasAttribute("tabindex")).toBeFalse();
|
|
266
236
|
expect(element.eq(1)[0].hasAttribute("tabindex")).toBeFalse();
|
|
267
237
|
});
|
|
@@ -270,7 +240,6 @@ describe("$aria", () => {
|
|
|
270
240
|
describe("aria-hidden", () => {
|
|
271
241
|
it("should attach aria-hidden to ng-show", () => {
|
|
272
242
|
element = $compile('<div ng-show="val"></div>')(scope);
|
|
273
|
-
scope.$digest();
|
|
274
243
|
scope.$apply("val = false");
|
|
275
244
|
expect(element.attr("aria-hidden")).toBe("true");
|
|
276
245
|
|
|
@@ -280,7 +249,6 @@ describe("$aria", () => {
|
|
|
280
249
|
|
|
281
250
|
it("should attach aria-hidden to ng-hide", () => {
|
|
282
251
|
element = $compile('<div ng-hide="val"></div>')(scope);
|
|
283
|
-
scope.$digest();
|
|
284
252
|
scope.$apply("val = false");
|
|
285
253
|
expect(element.attr("aria-hidden")).toBe("false");
|
|
286
254
|
|
|
@@ -292,7 +260,6 @@ describe("$aria", () => {
|
|
|
292
260
|
element = $compile(
|
|
293
261
|
'<div ng-show="val" aria-hidden="userSetValue"></div>',
|
|
294
262
|
)(scope);
|
|
295
|
-
scope.$digest();
|
|
296
263
|
expect(element.attr("aria-hidden")).toBe("userSetValue");
|
|
297
264
|
|
|
298
265
|
scope.$apply("val = true");
|
|
@@ -303,7 +270,6 @@ describe("$aria", () => {
|
|
|
303
270
|
element = $compile(
|
|
304
271
|
'<div ng-hide="val" aria-hidden="userSetValue"></div>',
|
|
305
272
|
)(scope);
|
|
306
|
-
scope.$digest();
|
|
307
273
|
expect(element.attr("aria-hidden")).toBe("userSetValue");
|
|
308
274
|
|
|
309
275
|
scope.$apply("val = true");
|
|
@@ -312,8 +278,6 @@ describe("$aria", () => {
|
|
|
312
278
|
|
|
313
279
|
it("should always set aria-hidden to a boolean value", () => {
|
|
314
280
|
element = $compile('<div ng-hide="val"></div>')(scope);
|
|
315
|
-
scope.$digest();
|
|
316
|
-
|
|
317
281
|
scope.$apply('val = "test angular"');
|
|
318
282
|
expect(element.attr("aria-hidden")).toBe("true");
|
|
319
283
|
|
|
@@ -324,8 +288,6 @@ describe("$aria", () => {
|
|
|
324
288
|
expect(element.attr("aria-hidden")).toBe("true");
|
|
325
289
|
|
|
326
290
|
element = $compile('<div ng-show="val"></div>')(scope);
|
|
327
|
-
scope.$digest();
|
|
328
|
-
|
|
329
291
|
scope.$apply('val = "test angular"');
|
|
330
292
|
expect(element.attr("aria-hidden")).toBe("false");
|
|
331
293
|
|
|
@@ -355,11 +317,9 @@ describe("$aria", () => {
|
|
|
355
317
|
it("should not attach aria-hidden", () => {
|
|
356
318
|
scope.$apply("val = false");
|
|
357
319
|
element = $compile('<div ng-show="val"></div>')(scope);
|
|
358
|
-
scope.$digest();
|
|
359
320
|
expect(element[0].hasAttribute("aria-hidden")).toBeFalse();
|
|
360
321
|
|
|
361
322
|
element = $compile('<div ng-hide="val"></div>')(scope);
|
|
362
|
-
scope.$digest();
|
|
363
323
|
expect(element[0].hasAttribute("aria-hidden")).toBeFalse();
|
|
364
324
|
});
|
|
365
325
|
});
|
|
@@ -367,8 +327,6 @@ describe("$aria", () => {
|
|
|
367
327
|
describe("aria-checked", () => {
|
|
368
328
|
it('should not attach itself to native input type="checkbox"', () => {
|
|
369
329
|
element = $compile('<input type="checkbox" ng-model="val">')(scope);
|
|
370
|
-
scope.$digest();
|
|
371
|
-
|
|
372
330
|
scope.$apply("val = true");
|
|
373
331
|
expect(element.attr("aria-checked")).toBeUndefined();
|
|
374
332
|
|
|
@@ -378,8 +336,6 @@ describe("$aria", () => {
|
|
|
378
336
|
|
|
379
337
|
it("should attach itself to custom checkbox", () => {
|
|
380
338
|
element = $compile('<div role="checkbox" ng-model="val"></div>')(scope);
|
|
381
|
-
scope.$digest();
|
|
382
|
-
|
|
383
339
|
scope.$apply('val = "checked"');
|
|
384
340
|
expect(element.attr("aria-checked")).toBe("true");
|
|
385
341
|
|
|
@@ -389,7 +345,6 @@ describe("$aria", () => {
|
|
|
389
345
|
|
|
390
346
|
it("should use `$isEmpty()` to determine if the checkbox is checked", () => {
|
|
391
347
|
element = $compile('<div role="checkbox" ng-model="val"></div>')(scope);
|
|
392
|
-
scope.$digest();
|
|
393
348
|
const ctrl = element.controller("ngModel");
|
|
394
349
|
ctrl.$isEmpty = function (value) {
|
|
395
350
|
return value === "not-checked";
|
|
@@ -416,8 +371,6 @@ describe("$aria", () => {
|
|
|
416
371
|
const element = $compile('<input type="checkbox" ng-checked="val">')(
|
|
417
372
|
scope,
|
|
418
373
|
);
|
|
419
|
-
scope.$digest();
|
|
420
|
-
|
|
421
374
|
scope.$apply("val = true");
|
|
422
375
|
expect(element.attr("aria-checked")).toBeUndefined();
|
|
423
376
|
|
|
@@ -504,7 +457,6 @@ describe("$aria", () => {
|
|
|
504
457
|
element = $compile(
|
|
505
458
|
'<div role="menuitemradio" ng-model="val" value="one"></div>',
|
|
506
459
|
)(scope);
|
|
507
|
-
scope.$digest();
|
|
508
460
|
expect(element.attr("aria-checked")).toBe("true");
|
|
509
461
|
|
|
510
462
|
scope.$apply("val = 'two'");
|
|
@@ -515,8 +467,6 @@ describe("$aria", () => {
|
|
|
515
467
|
element = $compile('<div role="menuitemcheckbox" ng-model="val"></div>')(
|
|
516
468
|
scope,
|
|
517
469
|
);
|
|
518
|
-
scope.$digest();
|
|
519
|
-
|
|
520
470
|
scope.$apply('val = "checked"');
|
|
521
471
|
expect(element.attr("aria-checked")).toBe("true");
|
|
522
472
|
|
|
@@ -547,7 +497,6 @@ describe("$aria", () => {
|
|
|
547
497
|
describe("roles for custom inputs", () => {
|
|
548
498
|
it('should add missing role="button" to custom input', () => {
|
|
549
499
|
element = $compile('<div ng-click="someFunction()"></div>')(scope);
|
|
550
|
-
scope.$digest();
|
|
551
500
|
expect(element.attr("role")).toBe("button");
|
|
552
501
|
});
|
|
553
502
|
|
|
@@ -558,37 +507,31 @@ describe("$aria", () => {
|
|
|
558
507
|
|
|
559
508
|
it('should add missing role="checkbox" to custom input', () => {
|
|
560
509
|
element = $compile('<div type="checkbox" ng-model="val"></div>')(scope);
|
|
561
|
-
scope.$digest();
|
|
562
510
|
expect(element.attr("role")).toBe("checkbox");
|
|
563
511
|
});
|
|
564
512
|
|
|
565
513
|
it("should not add a role to a native checkbox", () => {
|
|
566
514
|
element = $compile('<input type="checkbox" ng-model="val"/>')(scope);
|
|
567
|
-
scope.$digest();
|
|
568
515
|
expect(element.attr("role")).toBeUndefined();
|
|
569
516
|
});
|
|
570
517
|
|
|
571
518
|
it('should add missing role="radio" to custom input', () => {
|
|
572
519
|
element = $compile('<div type="radio" ng-model="val"></div>')(scope);
|
|
573
|
-
scope.$digest();
|
|
574
520
|
expect(element.attr("role")).toBe("radio");
|
|
575
521
|
});
|
|
576
522
|
|
|
577
523
|
it("should not add a role to a native radio button", () => {
|
|
578
524
|
element = $compile('<input type="radio" ng-model="val"/>')(scope);
|
|
579
|
-
scope.$digest();
|
|
580
525
|
expect(element.attr("role")).toBeUndefined();
|
|
581
526
|
});
|
|
582
527
|
|
|
583
528
|
it('should add missing role="slider" to custom input', () => {
|
|
584
529
|
element = $compile('<div type="range" ng-model="val"></div>')(scope);
|
|
585
|
-
scope.$digest();
|
|
586
530
|
expect(element.attr("role")).toBe("slider");
|
|
587
531
|
});
|
|
588
532
|
|
|
589
533
|
it("should not add a role to a native range input", () => {
|
|
590
534
|
element = $compile('<input type="range" ng-model="val"/>')(scope);
|
|
591
|
-
scope.$digest();
|
|
592
535
|
expect(element.attr("role")).toBeUndefined();
|
|
593
536
|
});
|
|
594
537
|
|
|
@@ -627,25 +570,21 @@ describe("$aria", () => {
|
|
|
627
570
|
element = $compile(
|
|
628
571
|
"<div role='radio' ng-model='val' value='{{val}}'></div>",
|
|
629
572
|
)(scope);
|
|
630
|
-
scope.$digest();
|
|
631
573
|
expect(element.attr("aria-checked")).toBeUndefined();
|
|
632
574
|
|
|
633
575
|
element = $compile(
|
|
634
576
|
"<div role='menuitemradio' ng-model='val' value='{{val}}'></div>",
|
|
635
577
|
)(scope);
|
|
636
|
-
scope.$digest();
|
|
637
578
|
expect(element.attr("aria-checked")).toBeUndefined();
|
|
638
579
|
|
|
639
580
|
element = $compile("<div role='checkbox' checked='checked'></div>")(
|
|
640
581
|
scope,
|
|
641
582
|
);
|
|
642
|
-
scope.$digest();
|
|
643
583
|
expect(element.attr("aria-checked")).toBeUndefined();
|
|
644
584
|
|
|
645
585
|
element = $compile(
|
|
646
586
|
"<div role='menuitemcheckbox' checked='checked'></div>",
|
|
647
587
|
)(scope);
|
|
648
|
-
scope.$digest();
|
|
649
588
|
expect(element.attr("aria-checked")).toBeUndefined();
|
|
650
589
|
});
|
|
651
590
|
});
|
|
@@ -668,7 +607,6 @@ describe("$aria", () => {
|
|
|
668
607
|
|
|
669
608
|
it("should attach itself to custom controls", () => {
|
|
670
609
|
element = $compile('<div ng-disabled="val"></div>')(scope);
|
|
671
|
-
scope.$digest();
|
|
672
610
|
expect(element.attr("aria-disabled")).toBe("false");
|
|
673
611
|
|
|
674
612
|
scope.$apply("val = true");
|
|
@@ -679,8 +617,6 @@ describe("$aria", () => {
|
|
|
679
617
|
element = $compile(
|
|
680
618
|
'<div ng-disabled="val" aria-disabled="userSetValue"></div>',
|
|
681
619
|
)(scope);
|
|
682
|
-
scope.$digest();
|
|
683
|
-
|
|
684
620
|
expect(element.attr("aria-disabled")).toBe("userSetValue");
|
|
685
621
|
});
|
|
686
622
|
|
|
@@ -811,7 +747,6 @@ describe("$aria", () => {
|
|
|
811
747
|
|
|
812
748
|
it("should attach itself to custom controls", () => {
|
|
813
749
|
element = $compile('<div ng-readonly="val"></div>')(scope);
|
|
814
|
-
scope.$digest();
|
|
815
750
|
expect(element.attr("aria-readonly")).toBe("false");
|
|
816
751
|
|
|
817
752
|
scope.$apply("val = true");
|
|
@@ -822,7 +757,6 @@ describe("$aria", () => {
|
|
|
822
757
|
element = $compile(
|
|
823
758
|
'<div ng-readonly="val" aria-readonly="userSetValue"></div>',
|
|
824
759
|
)(scope);
|
|
825
|
-
scope.$digest();
|
|
826
760
|
expect(element.attr("aria-readonly")).toBe("userSetValue");
|
|
827
761
|
});
|
|
828
762
|
|
|
@@ -869,7 +803,6 @@ describe("$aria", () => {
|
|
|
869
803
|
describe("aria-required", () => {
|
|
870
804
|
it("should not attach to input", () => {
|
|
871
805
|
element = $compile('<input ng-model="val" required>')(scope);
|
|
872
|
-
scope.$digest();
|
|
873
806
|
expect(element.attr("aria-required")).toBeUndefined();
|
|
874
807
|
});
|
|
875
808
|
|
|
@@ -877,7 +810,6 @@ describe("$aria", () => {
|
|
|
877
810
|
element = $compile('<div ng-model="val" role="checkbox" required></div>')(
|
|
878
811
|
scope,
|
|
879
812
|
);
|
|
880
|
-
scope.$digest();
|
|
881
813
|
expect(element.attr("aria-required")).toBe("true");
|
|
882
814
|
});
|
|
883
815
|
|
|
@@ -885,7 +817,6 @@ describe("$aria", () => {
|
|
|
885
817
|
element = $compile(
|
|
886
818
|
"<div role='checkbox' ng-required='false' ng-model='val'></div>",
|
|
887
819
|
)(scope);
|
|
888
|
-
scope.$digest();
|
|
889
820
|
expect(element.attr("aria-required")).toBe("false");
|
|
890
821
|
});
|
|
891
822
|
|
|
@@ -893,7 +824,6 @@ describe("$aria", () => {
|
|
|
893
824
|
element = $compile(
|
|
894
825
|
'<div role="checkbox" ng-model="val" ng-required="true"></div>',
|
|
895
826
|
)(scope);
|
|
896
|
-
scope.$digest();
|
|
897
827
|
expect(element.attr("aria-required")).toBe("true");
|
|
898
828
|
});
|
|
899
829
|
|
|
@@ -922,13 +852,11 @@ describe("$aria", () => {
|
|
|
922
852
|
|
|
923
853
|
it("should not add the aria-required attribute", () => {
|
|
924
854
|
element = $compile("<input ng-model='val' required>")(scope);
|
|
925
|
-
scope.$digest();
|
|
926
855
|
expect(element.attr("aria-required")).toBeUndefined();
|
|
927
856
|
|
|
928
857
|
element = $compile("<div ng-model='val' ng-required='true'></div>")(
|
|
929
858
|
scope,
|
|
930
859
|
);
|
|
931
|
-
scope.$digest();
|
|
932
860
|
expect(element.attr("aria-required")).toBeUndefined();
|
|
933
861
|
});
|
|
934
862
|
});
|
|
@@ -978,7 +906,6 @@ describe("$aria", () => {
|
|
|
978
906
|
element = $compile(
|
|
979
907
|
'<input type="range" ng-model="val" min="{{min}}" max="{{max}}" />',
|
|
980
908
|
)(scope);
|
|
981
|
-
scope.$digest();
|
|
982
909
|
expect(element.attr("aria-valuemin")).toBe("25");
|
|
983
910
|
expect(element.attr("aria-valuemax")).toBe("75");
|
|
984
911
|
|
|
@@ -994,7 +921,6 @@ describe("$aria", () => {
|
|
|
994
921
|
element = $compile(
|
|
995
922
|
'<input type="range" ng-model="val" ng-min="min" ng-max="max" />',
|
|
996
923
|
)(scope);
|
|
997
|
-
scope.$digest();
|
|
998
924
|
expect(element.attr("aria-valuemin")).toBe("25");
|
|
999
925
|
expect(element.attr("aria-valuemax")).toBe("75");
|
|
1000
926
|
|
|
@@ -1011,7 +937,6 @@ describe("$aria", () => {
|
|
|
1011
937
|
const element = [
|
|
1012
938
|
$compile('<div ng-messages="myForm.myName.$error">')(scope),
|
|
1013
939
|
];
|
|
1014
|
-
scope.$digest();
|
|
1015
940
|
expectAriaAttrOnEachElement(element, "aria-live", "assertive");
|
|
1016
941
|
});
|
|
1017
942
|
});
|
|
@@ -1037,7 +962,6 @@ describe("$aria", () => {
|
|
|
1037
962
|
element = $compile(
|
|
1038
963
|
'<input type="range" ng-model="val" min="0" max="100">',
|
|
1039
964
|
)(scope);
|
|
1040
|
-
scope.$digest();
|
|
1041
965
|
expect(element.attr("aria-valuenow")).toBeUndefined();
|
|
1042
966
|
expect(element.attr("aria-valuemin")).toBeUndefined();
|
|
1043
967
|
expect(element.attr("aria-valuemax")).toBeUndefined();
|
|
@@ -1045,7 +969,6 @@ describe("$aria", () => {
|
|
|
1045
969
|
element = $compile(
|
|
1046
970
|
'<div role="progressbar" min="0" max="100" ng-model="val">',
|
|
1047
971
|
)(scope);
|
|
1048
|
-
scope.$digest();
|
|
1049
972
|
expect(element.attr("aria-valuenow")).toBeUndefined();
|
|
1050
973
|
expect(element.attr("aria-valuemin")).toBeUndefined();
|
|
1051
974
|
expect(element.attr("aria-valuemax")).toBeUndefined();
|
|
@@ -1065,34 +988,28 @@ describe("$aria", () => {
|
|
|
1065
988
|
"<details ng-model='val'></details>",
|
|
1066
989
|
].forEach((html) => {
|
|
1067
990
|
element = $compile(html)(scope);
|
|
1068
|
-
scope.$digest();
|
|
1069
991
|
expect(element.attr("tabindex")).toBeUndefined();
|
|
1070
992
|
});
|
|
1071
993
|
});
|
|
1072
994
|
|
|
1073
995
|
it("should not attach to random ng-model elements", () => {
|
|
1074
996
|
element = $compile('<div ng-model="val"></div>')(scope);
|
|
1075
|
-
scope.$digest();
|
|
1076
997
|
expect(element.attr("tabindex")).toBeUndefined();
|
|
1077
998
|
});
|
|
1078
999
|
|
|
1079
1000
|
it("should attach tabindex to custom inputs", () => {
|
|
1080
1001
|
element = $compile('<div role="checkbox" ng-model="val"></div>')(scope);
|
|
1081
|
-
scope.$digest();
|
|
1082
1002
|
expect(element.attr("tabindex")).toBe("0");
|
|
1083
1003
|
|
|
1084
1004
|
element = $compile('<div role="slider" ng-model="val"></div>')(scope);
|
|
1085
|
-
scope.$digest();
|
|
1086
1005
|
expect(element.attr("tabindex")).toBe("0");
|
|
1087
1006
|
});
|
|
1088
1007
|
|
|
1089
1008
|
it("should attach to ng-click and ng-dblclick", () => {
|
|
1090
1009
|
element = $compile('<div ng-click="someAction()"></div>')(scope);
|
|
1091
|
-
scope.$digest();
|
|
1092
1010
|
expect(element.attr("tabindex")).toBe("0");
|
|
1093
1011
|
|
|
1094
1012
|
element = $compile('<div ng-dblclick="someAction()"></div>')(scope);
|
|
1095
|
-
scope.$digest();
|
|
1096
1013
|
expect(element.attr("tabindex")).toBe("0");
|
|
1097
1014
|
});
|
|
1098
1015
|
|
|
@@ -1100,25 +1017,21 @@ describe("$aria", () => {
|
|
|
1100
1017
|
element = $compile('<div role="button" tabindex="userSetValue"></div>')(
|
|
1101
1018
|
scope,
|
|
1102
1019
|
);
|
|
1103
|
-
scope.$digest();
|
|
1104
1020
|
expect(element.attr("tabindex")).toBe("userSetValue");
|
|
1105
1021
|
|
|
1106
1022
|
element = $compile('<div role="checkbox" tabindex="userSetValue"></div>')(
|
|
1107
1023
|
scope,
|
|
1108
1024
|
);
|
|
1109
|
-
scope.$digest();
|
|
1110
1025
|
expect(element.attr("tabindex")).toBe("userSetValue");
|
|
1111
1026
|
|
|
1112
1027
|
element = $compile(
|
|
1113
1028
|
'<div ng-click="someAction()" tabindex="userSetValue"></div>',
|
|
1114
1029
|
)(scope);
|
|
1115
|
-
scope.$digest();
|
|
1116
1030
|
expect(element.attr("tabindex")).toBe("userSetValue");
|
|
1117
1031
|
|
|
1118
1032
|
element = $compile(
|
|
1119
1033
|
'<div ng-dblclick="someAction()" tabindex="userSetValue"></div>',
|
|
1120
1034
|
)(scope);
|
|
1121
|
-
scope.$digest();
|
|
1122
1035
|
expect(element.attr("tabindex")).toBe("userSetValue");
|
|
1123
1036
|
});
|
|
1124
1037
|
});
|
|
@@ -23,7 +23,6 @@ describe("ngSrcset", () => {
|
|
|
23
23
|
it("should not result empty string in img srcset", () => {
|
|
24
24
|
$scope.image = {};
|
|
25
25
|
element = $compile('<img ng-srcset="{{image.url}} 2x">')($scope);
|
|
26
|
-
$scope.$digest();
|
|
27
26
|
expect(element.attr("srcset")).toBeUndefined();
|
|
28
27
|
});
|
|
29
28
|
|
|
@@ -31,7 +30,6 @@ describe("ngSrcset", () => {
|
|
|
31
30
|
$scope.imageUrl =
|
|
32
31
|
"http://example.com/image1.png 1x, http://example.com/image2.png 2x";
|
|
33
32
|
element = $compile('<img ng-srcset="{{imageUrl}}">')($scope);
|
|
34
|
-
$scope.$digest();
|
|
35
33
|
expect(element.attr("srcset")).toBe(
|
|
36
34
|
"http://example.com/image1.png 1x,http://example.com/image2.png 2x",
|
|
37
35
|
);
|
|
@@ -41,7 +39,6 @@ describe("ngSrcset", () => {
|
|
|
41
39
|
$scope.imageUrl =
|
|
42
40
|
"http://example.com/image1.png 1x, javascript:doEvilStuff() 2x";
|
|
43
41
|
element = $compile('<img ng-srcset="{{imageUrl}}">')($scope);
|
|
44
|
-
$scope.$digest();
|
|
45
42
|
expect(element.attr("srcset")).toBe(
|
|
46
43
|
"http://example.com/image1.png 1x,unsafe:javascript:doEvilStuff() 2x",
|
|
47
44
|
);
|
|
@@ -49,13 +46,11 @@ describe("ngSrcset", () => {
|
|
|
49
46
|
|
|
50
47
|
it("should not throw an error if undefined", () => {
|
|
51
48
|
element = $compile('<img ng-attr-srcset="{{undefined}}">')($scope);
|
|
52
|
-
$scope.$digest();
|
|
53
49
|
});
|
|
54
50
|
|
|
55
51
|
it("should interpolate the expression and bind to srcset", () => {
|
|
56
52
|
const element = $compile('<img ng-srcset="some/{{id}} 2x"></div>')($scope);
|
|
57
53
|
|
|
58
|
-
$scope.$digest();
|
|
59
54
|
expect(element.attr("srcset")).toBeUndefined();
|
|
60
55
|
|
|
61
56
|
$scope.$apply(() => {
|
|
@@ -29,10 +29,8 @@ describe("boolean attr directives", () => {
|
|
|
29
29
|
$rootScope,
|
|
30
30
|
);
|
|
31
31
|
$rootScope.isDisabled = 0;
|
|
32
|
-
$rootScope.$digest();
|
|
33
32
|
expect(element.attr("disabled")).toBeFalsy();
|
|
34
33
|
$rootScope.isDisabled = 1;
|
|
35
|
-
$rootScope.$digest();
|
|
36
34
|
expect(element.attr("disabled")).toBeTruthy();
|
|
37
35
|
});
|
|
38
36
|
|
|
@@ -41,10 +39,8 @@ describe("boolean attr directives", () => {
|
|
|
41
39
|
$rootScope,
|
|
42
40
|
);
|
|
43
41
|
$rootScope.isDisabled = false;
|
|
44
|
-
$rootScope.$digest();
|
|
45
42
|
expect(element.attr("disabled")).toBeFalsy();
|
|
46
43
|
$rootScope.isDisabled = true;
|
|
47
|
-
$rootScope.$digest();
|
|
48
44
|
expect(element.attr("disabled")).toBeTruthy();
|
|
49
45
|
});
|
|
50
46
|
|
|
@@ -53,10 +49,8 @@ describe("boolean attr directives", () => {
|
|
|
53
49
|
$rootScope,
|
|
54
50
|
);
|
|
55
51
|
$rootScope.isChecked = false;
|
|
56
|
-
$rootScope.$digest();
|
|
57
52
|
expect(element.attr("checked")).toBeFalsy();
|
|
58
53
|
$rootScope.isChecked = true;
|
|
59
|
-
$rootScope.$digest();
|
|
60
54
|
expect(element.attr("checked")).toBeTruthy();
|
|
61
55
|
});
|
|
62
56
|
|
|
@@ -68,7 +62,6 @@ describe("boolean attr directives", () => {
|
|
|
68
62
|
)($rootScope);
|
|
69
63
|
|
|
70
64
|
$rootScope.value = "true";
|
|
71
|
-
$rootScope.$digest();
|
|
72
65
|
expect(element[0].checked).toBe(true);
|
|
73
66
|
|
|
74
67
|
element[0].checked = !element[0].checked;
|
|
@@ -86,10 +79,8 @@ describe("boolean attr directives", () => {
|
|
|
86
79
|
'<select><option value=""></option><option ng-selected="isSelected">Greetings!</option></select>',
|
|
87
80
|
)($rootScope);
|
|
88
81
|
$rootScope.isSelected = false;
|
|
89
|
-
$rootScope.$digest();
|
|
90
82
|
expect(element.children()[1].selected).toBeFalsy();
|
|
91
83
|
$rootScope.isSelected = true;
|
|
92
|
-
$rootScope.$digest();
|
|
93
84
|
expect(element.children()[1].selected).toBeTruthy();
|
|
94
85
|
});
|
|
95
86
|
|
|
@@ -98,20 +89,16 @@ describe("boolean attr directives", () => {
|
|
|
98
89
|
$rootScope,
|
|
99
90
|
);
|
|
100
91
|
$rootScope.isReadonly = false;
|
|
101
|
-
$rootScope.$digest();
|
|
102
92
|
expect(element.attr("readOnly")).toBeFalsy();
|
|
103
93
|
$rootScope.isReadonly = true;
|
|
104
|
-
$rootScope.$digest();
|
|
105
94
|
expect(element.attr("readOnly")).toBeTruthy();
|
|
106
95
|
});
|
|
107
96
|
|
|
108
97
|
it("should bind open", () => {
|
|
109
98
|
element = $compile('<details ng-open="isOpen"></details>')($rootScope);
|
|
110
99
|
$rootScope.isOpen = false;
|
|
111
|
-
$rootScope.$digest();
|
|
112
100
|
expect(element.attr("open")).toBeFalsy();
|
|
113
101
|
$rootScope.isOpen = true;
|
|
114
|
-
$rootScope.$digest();
|
|
115
102
|
expect(element.attr("open")).toBeTruthy();
|
|
116
103
|
});
|
|
117
104
|
|
|
@@ -121,10 +108,8 @@ describe("boolean attr directives", () => {
|
|
|
121
108
|
$rootScope,
|
|
122
109
|
);
|
|
123
110
|
$rootScope.isMultiple = false;
|
|
124
|
-
$rootScope.$digest();
|
|
125
111
|
expect(element.attr("multiple")).toBeFalsy();
|
|
126
112
|
$rootScope.isMultiple = "multiple";
|
|
127
|
-
$rootScope.$digest();
|
|
128
113
|
expect(element.attr("multiple")).toBeFalsy(); // ignore
|
|
129
114
|
});
|
|
130
115
|
|
|
@@ -25,8 +25,6 @@ describe("style", () => {
|
|
|
25
25
|
'<style type="text/css">.header{font-size:1.5em; h3{font-size:1.5em}}</style>',
|
|
26
26
|
);
|
|
27
27
|
$compile(element)($rootScope);
|
|
28
|
-
$rootScope.$digest();
|
|
29
|
-
|
|
30
28
|
expect(element[0].innerHTML).toBe(
|
|
31
29
|
".header{font-size:1.5em; h3{font-size:1.5em}}",
|
|
32
30
|
);
|
|
@@ -37,8 +35,6 @@ describe("style", () => {
|
|
|
37
35
|
'<style type="text/css">.some-container{ width: {{elementWidth}}px; }</style>',
|
|
38
36
|
);
|
|
39
37
|
$compile(element)($rootScope);
|
|
40
|
-
$rootScope.$digest();
|
|
41
|
-
|
|
42
38
|
expect(element[0].innerHTML).toBe(".some-container{ width: px; }");
|
|
43
39
|
|
|
44
40
|
$rootScope.$apply(() => {
|
|
@@ -53,8 +49,6 @@ describe("style", () => {
|
|
|
53
49
|
'<style type="text/css">.header{ h3 { font-size: {{fontSize}}em }}</style>',
|
|
54
50
|
);
|
|
55
51
|
$compile(element)($rootScope);
|
|
56
|
-
$rootScope.$digest();
|
|
57
|
-
|
|
58
52
|
expect(element[0].innerHTML).toBe(".header{ h3 { font-size: em }}");
|
|
59
53
|
|
|
60
54
|
$rootScope.$apply(() => {
|
|
@@ -69,8 +63,6 @@ describe("style", () => {
|
|
|
69
63
|
'<style type="text/css">.header{ h3 { font-size: {{fontSize}}{{unit}} }}</style>',
|
|
70
64
|
);
|
|
71
65
|
$compile(element)($rootScope);
|
|
72
|
-
$rootScope.$digest();
|
|
73
|
-
|
|
74
66
|
expect(element[0].innerHTML).toBe(".header{ h3 { font-size: }}");
|
|
75
67
|
|
|
76
68
|
$rootScope.$apply(() => {
|