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