@angular-wave/angular.ts 0.4.2 → 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.esm.js +2 -2
- package/dist/angular-ts.umd.js +12 -2
- package/index.html +74 -3
- package/package.json +7 -7
- package/src/angular.spec.js +1 -269
- package/src/animations/animate-css-driver.js +2 -2
- package/src/animations/animate-css.js +12 -21
- package/src/animations/animate-js-driver.js +1 -3
- package/src/animations/animate-js.js +4 -4
- package/src/animations/animate-queue.js +23 -23
- 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 +4 -4
- package/src/animations/shared.js +14 -12
- package/src/binding.spec.js +0 -1
- package/src/core/cache/cache.js +2 -29
- package/src/core/compile/attributes.js +2 -3
- package/src/core/compile/compile.js +260 -245
- package/src/core/compile/compile.spec.js +63 -317
- 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/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 +28 -7
- package/src/core/parse/parse.spec.js +95 -91
- package/src/core/prop.spec.js +4 -60
- package/src/core/sce/sce.js +1 -2
- package/src/core/sce/sce.spec.js +0 -8
- package/src/core/scope/scope.js +62 -32
- 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/{list/list.test.js → attrs/attrs.test.js} +1 -1
- package/src/{core/q/q.html → directive/attrs/boolean.html} +1 -1
- package/src/directive/attrs/boolean.spec.js +0 -15
- package/src/{core/q/q.test.js → directive/attrs/boolean.test.js} +1 -2
- package/src/{core/timeout/timeout.html → directive/attrs/element-style.html} +4 -1
- package/src/directive/attrs/element-style.spec.js +0 -8
- package/src/{core/scope/scope.test.js → directive/attrs/element-style.test.js} +1 -2
- 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 +1 -4
- package/src/{core/interval/interval.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/channel/channel.test.js +9 -0
- 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 +14 -22
- package/src/directive/form/form.spec.js +0 -65
- package/src/directive/if/if.spec.js +2 -7
- package/src/directive/if/if.test.js +1 -2
- package/src/directive/include/include.js +2 -2
- 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.js +1 -2
- package/src/directive/input/input.spec.js +191 -331
- package/src/directive/messages/messages.spec.js +4 -35
- package/src/directive/model/model.js +30 -42
- package/src/directive/model/model.spec.js +2 -49
- package/src/directive/model-options/model-options.js +22 -26
- 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.js +1 -3
- package/src/directive/options/options.spec.js +3 -38
- package/src/directive/ref/href.spec.js +0 -15
- package/src/directive/repeat/repeat.js +2 -2
- package/src/directive/repeat/repeat.spec.js +56 -192
- package/src/directive/script/script.spec.js +0 -2
- package/src/directive/select/select.js +3 -3
- package/src/directive/select/select.spec.js +9 -106
- 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.js +1 -2
- 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 +24 -30
- package/src/router/directives/state-directives.spec.js +0 -83
- package/src/router/directives/view-directive.js +6 -15
- 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 +9 -12
- 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/url/url-service.js +2 -8
- package/src/router/url/url-service.spec.js +3 -4
- package/src/router/view-hook.spec.js +2 -2
- package/src/router/view-scroll.js +4 -6
- package/src/services/http/http.js +11 -15
- 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.js +19 -17
- package/src/services/http-backend/http-backend.spec.js +3 -3
- package/src/services/template-request.js +2 -4
- package/src/shared/common.js +6 -10
- package/src/shared/jqlite/jqlite.js +14 -15
- package/src/shared/jqlite/jqlite.spec.js +2 -2
- package/src/shared/utils.js +15 -92
- 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/types/directive/form/form.d.ts +1 -0
- package/types/shared/common.d.ts +0 -1
- package/types/shared/utils.d.ts +0 -35
- package/src/core/interval/interval-factory.js +0 -50
- 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/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
|
@@ -43,8 +43,6 @@ describe("scriptDirective", () => {
|
|
|
43
43
|
'<script type="text/javascript">some {{binding}}</script>' +
|
|
44
44
|
'<script type="text/ng-template" id="/some">other {{binding}}</script>';
|
|
45
45
|
$compile(doc)($rootScope);
|
|
46
|
-
$rootScope.$digest();
|
|
47
|
-
|
|
48
46
|
const scripts = doc.find("script");
|
|
49
47
|
expect(scripts.eq(0)[0].text).toBe("some {{binding}}");
|
|
50
48
|
expect(scripts.eq(1)[0].text).toBe("other {{binding}}");
|
|
@@ -226,7 +226,7 @@ function SelectController($element, $scope) {
|
|
|
226
226
|
function scheduleRender() {
|
|
227
227
|
if (renderScheduled) return;
|
|
228
228
|
renderScheduled = true;
|
|
229
|
-
$scope
|
|
229
|
+
$scope.$postUpdate(() => {
|
|
230
230
|
renderScheduled = false;
|
|
231
231
|
self.ngModelCtrl.$render();
|
|
232
232
|
});
|
|
@@ -238,7 +238,7 @@ function SelectController($element, $scope) {
|
|
|
238
238
|
|
|
239
239
|
updateScheduled = true;
|
|
240
240
|
|
|
241
|
-
$scope
|
|
241
|
+
$scope.$postUpdate(() => {
|
|
242
242
|
if ($scope.$$destroyed) return;
|
|
243
243
|
|
|
244
244
|
updateScheduled = false;
|
|
@@ -349,7 +349,7 @@ function SelectController($element, $scope) {
|
|
|
349
349
|
currentValue === removeValue
|
|
350
350
|
) {
|
|
351
351
|
// When multiple (selected) options are destroyed at the same time, we don't want
|
|
352
|
-
// to run a model update for each of them. Instead, run a single update in the
|
|
352
|
+
// to run a model update for each of them. Instead, run a single update in the $postUpdate
|
|
353
353
|
scheduleViewValueUpdate(true);
|
|
354
354
|
}
|
|
355
355
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Angular } from "../../loader";
|
|
2
|
-
import { createInjector } from "../../core/di/injector";
|
|
3
2
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
|
-
import {
|
|
3
|
+
import { hashKey, equals, isNumberNaN } from "../../shared/utils";
|
|
5
4
|
import { browserTrigger } from "../../shared/test-utils";
|
|
6
5
|
|
|
7
6
|
describe("select", () => {
|
|
@@ -20,7 +19,6 @@ describe("select", () => {
|
|
|
20
19
|
element = formElement.find("select");
|
|
21
20
|
$compile(formElement)(scope);
|
|
22
21
|
ngModelCtrl = element.controller("ngModel");
|
|
23
|
-
scope.$digest();
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
function setSelectValue(selectElement, optionIndex) {
|
|
@@ -118,8 +116,9 @@ describe("select", () => {
|
|
|
118
116
|
const actualValues = {};
|
|
119
117
|
let optionGroup;
|
|
120
118
|
let optionValue;
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
let options = actual.find("option");
|
|
120
|
+
for (let i = 0; i < options.length; i++) {
|
|
121
|
+
let option = options[i];
|
|
123
122
|
optionGroup = option.parentNode.label || "";
|
|
124
123
|
actualValues[optionGroup] = actualValues[optionGroup] || [];
|
|
125
124
|
// IE9 doesn't populate the label property from the text property like other browsers
|
|
@@ -127,7 +126,7 @@ describe("select", () => {
|
|
|
127
126
|
actualValues[optionGroup].push(
|
|
128
127
|
option.selected ? [optionValue] : optionValue,
|
|
129
128
|
);
|
|
130
|
-
}
|
|
129
|
+
}
|
|
131
130
|
|
|
132
131
|
const message = function () {
|
|
133
132
|
return `Expected ${toJson(actualValues)} to equal ${toJson(expected)}.`;
|
|
@@ -350,7 +349,6 @@ describe("select", () => {
|
|
|
350
349
|
expect(scope.form.nameA.$name).toBe("nameA");
|
|
351
350
|
const oldModel = scope.form.nameA;
|
|
352
351
|
scope.nameID = "B";
|
|
353
|
-
scope.$digest();
|
|
354
352
|
expect(scope.form.nameA).toBeUndefined();
|
|
355
353
|
expect(scope.form.nameB).toBe(oldModel);
|
|
356
354
|
expect(scope.form.nameB.$name).toBe("nameB");
|
|
@@ -398,7 +396,6 @@ describe("select", () => {
|
|
|
398
396
|
$compile(select)(scope);
|
|
399
397
|
expect(selectCtrl.writeValue).not.toHaveBeenCalled();
|
|
400
398
|
|
|
401
|
-
scope.$digest();
|
|
402
399
|
expect(selectCtrl.writeValue).toHaveBeenCalled();
|
|
403
400
|
dealoc(select);
|
|
404
401
|
});
|
|
@@ -412,16 +409,12 @@ describe("select", () => {
|
|
|
412
409
|
"</select>",
|
|
413
410
|
);
|
|
414
411
|
|
|
415
|
-
scope.$digest();
|
|
416
|
-
|
|
417
412
|
let options = element.find("option");
|
|
418
413
|
expect(options[0].selected).toBeTrue();
|
|
419
414
|
expect(options[1].selected).toBeFalse();
|
|
420
415
|
expect(options[2].selected).toBeFalse();
|
|
421
416
|
|
|
422
417
|
scope.selected = "a";
|
|
423
|
-
scope.$digest();
|
|
424
|
-
|
|
425
418
|
options = element.find("option");
|
|
426
419
|
expect(options.length).toBe(3);
|
|
427
420
|
expect(options[0].selected).toBeFalse();
|
|
@@ -429,8 +422,6 @@ describe("select", () => {
|
|
|
429
422
|
expect(options[2].selected).toBeFalse();
|
|
430
423
|
|
|
431
424
|
scope.selected = "b";
|
|
432
|
-
scope.$digest();
|
|
433
|
-
|
|
434
425
|
options = element.find("option");
|
|
435
426
|
expect(options[0].selected).toBeFalse();
|
|
436
427
|
expect(options[1].selected).toBeFalse();
|
|
@@ -438,15 +429,12 @@ describe("select", () => {
|
|
|
438
429
|
|
|
439
430
|
// This will select the empty option
|
|
440
431
|
scope.selected = null;
|
|
441
|
-
scope.$digest();
|
|
442
|
-
|
|
443
432
|
expect(options[0].selected).toBeTrue();
|
|
444
433
|
expect(options[1].selected).toBeFalse();
|
|
445
434
|
expect(options[2].selected).toBeFalse();
|
|
446
435
|
|
|
447
436
|
// This will add and select the unknown option
|
|
448
437
|
scope.selected = "unmatched value";
|
|
449
|
-
scope.$digest();
|
|
450
438
|
options = element.find("option");
|
|
451
439
|
|
|
452
440
|
expect(options[0].selected).toBeTrue();
|
|
@@ -456,7 +444,6 @@ describe("select", () => {
|
|
|
456
444
|
|
|
457
445
|
// Back to matched value
|
|
458
446
|
scope.selected = "b";
|
|
459
|
-
scope.$digest();
|
|
460
447
|
options = element.find("option");
|
|
461
448
|
|
|
462
449
|
expect(options[0].selected).toBeFalse();
|
|
@@ -481,20 +468,15 @@ describe("select", () => {
|
|
|
481
468
|
{ val: "x", display: "robot x" },
|
|
482
469
|
{ val: "y", display: "robot y" },
|
|
483
470
|
];
|
|
484
|
-
scope.$digest();
|
|
485
|
-
|
|
486
471
|
expect(element[0].value).toBe("");
|
|
487
472
|
|
|
488
473
|
scope.robot = "x";
|
|
489
|
-
scope.$digest();
|
|
490
474
|
expect(element[0].value).toBe("x");
|
|
491
475
|
scope.dynamicOptions.shift();
|
|
492
476
|
|
|
493
|
-
scope.$digest();
|
|
494
477
|
expect(element[0].value).toBe("x");
|
|
495
478
|
|
|
496
479
|
scope.robot = undefined;
|
|
497
|
-
scope.$digest();
|
|
498
480
|
expect(element[0].value).toBe(unknownValue(undefined));
|
|
499
481
|
});
|
|
500
482
|
|
|
@@ -509,11 +491,9 @@ describe("select", () => {
|
|
|
509
491
|
'<option ng-repeat="opt in dynamicOptions" value="{{opt.val}}">{{opt.display}}</option>' +
|
|
510
492
|
"</select>",
|
|
511
493
|
);
|
|
512
|
-
scope.$digest();
|
|
513
494
|
expect(element[0].value).toBe(unknownValue("x"));
|
|
514
495
|
|
|
515
496
|
scope.robot = undefined;
|
|
516
|
-
scope.$digest();
|
|
517
497
|
expect(element.find("option").eq(0)[0].selected).toBe(true);
|
|
518
498
|
expect(element.find("option").eq(0).text()).toBe("--static-select--");
|
|
519
499
|
|
|
@@ -522,11 +502,9 @@ describe("select", () => {
|
|
|
522
502
|
{ val: "x", display: "robot x" },
|
|
523
503
|
{ val: "y", display: "robot y" },
|
|
524
504
|
];
|
|
525
|
-
scope.$digest();
|
|
526
505
|
expect(element[0].value).toBe("");
|
|
527
506
|
|
|
528
507
|
scope.dynamicOptions = [];
|
|
529
|
-
scope.$digest();
|
|
530
508
|
expect(element[0].value).toBe("");
|
|
531
509
|
});
|
|
532
510
|
|
|
@@ -583,8 +561,6 @@ describe("select", () => {
|
|
|
583
561
|
expect(element[0].value).toBe(unknownValue("other"));
|
|
584
562
|
|
|
585
563
|
scope.robot = undefined;
|
|
586
|
-
scope.$digest();
|
|
587
|
-
|
|
588
564
|
expect(element[0].value).toBe("");
|
|
589
565
|
});
|
|
590
566
|
|
|
@@ -671,8 +647,6 @@ describe("select", () => {
|
|
|
671
647
|
"</select>",
|
|
672
648
|
);
|
|
673
649
|
|
|
674
|
-
scope.$digest();
|
|
675
|
-
|
|
676
650
|
let options = element.find("option");
|
|
677
651
|
expect(options.length).toBe(3);
|
|
678
652
|
expect(options[0].selected).toBeTrue();
|
|
@@ -680,8 +654,6 @@ describe("select", () => {
|
|
|
680
654
|
expect(options[2].selected).toBeFalse();
|
|
681
655
|
|
|
682
656
|
scope.selected = "a";
|
|
683
|
-
scope.$digest();
|
|
684
|
-
|
|
685
657
|
options = element.find("option");
|
|
686
658
|
expect(options.length).toBe(3);
|
|
687
659
|
expect(options[0].selected).toBeFalse();
|
|
@@ -689,8 +661,6 @@ describe("select", () => {
|
|
|
689
661
|
expect(options[2].selected).toBeFalse();
|
|
690
662
|
|
|
691
663
|
scope.selected = "no match";
|
|
692
|
-
scope.$digest();
|
|
693
|
-
|
|
694
664
|
options = element.find("option");
|
|
695
665
|
expect(options[0].selected).toBeTrue();
|
|
696
666
|
expect(options[1].selected).toBeFalse();
|
|
@@ -930,7 +900,6 @@ describe("select", () => {
|
|
|
930
900
|
];
|
|
931
901
|
scope.empty = true;
|
|
932
902
|
|
|
933
|
-
scope.$digest();
|
|
934
903
|
expect(element[0].value).toBe("");
|
|
935
904
|
expect(selectCtrl.$hasEmptyOption()).toBe(true);
|
|
936
905
|
expect(selectCtrl.$isEmptyOptionSelected()).toBe(true);
|
|
@@ -1435,14 +1404,12 @@ describe("select", () => {
|
|
|
1435
1404
|
"</select>",
|
|
1436
1405
|
);
|
|
1437
1406
|
|
|
1438
|
-
scope.$digest();
|
|
1439
1407
|
expect(scope.selected).toBeUndefined();
|
|
1440
1408
|
|
|
1441
1409
|
setSelectValue(element, 0);
|
|
1442
1410
|
expect(scope.selected).toBe("option1");
|
|
1443
1411
|
|
|
1444
1412
|
scope.selected = "option2";
|
|
1445
|
-
scope.$digest();
|
|
1446
1413
|
expect(element.find("option").eq(1)[0].selected).toBe(true);
|
|
1447
1414
|
expect(element.find("option").eq(1).text()).toBe("Option 2");
|
|
1448
1415
|
});
|
|
@@ -1461,15 +1428,12 @@ describe("select", () => {
|
|
|
1461
1428
|
const selectCtrl = element.controller("select");
|
|
1462
1429
|
spyOn(selectCtrl, "removeOption").and.callThrough();
|
|
1463
1430
|
|
|
1464
|
-
scope.$digest();
|
|
1465
1431
|
expect(scope.selected).toBeUndefined();
|
|
1466
1432
|
expect(selectCtrl.removeOption).not.toHaveBeenCalled();
|
|
1467
1433
|
|
|
1468
1434
|
// Change value of option2
|
|
1469
1435
|
scope.option2 = "option2Changed";
|
|
1470
1436
|
scope.selected = "option2Changed";
|
|
1471
|
-
scope.$digest();
|
|
1472
|
-
|
|
1473
1437
|
expect(selectCtrl.removeOption).toHaveBeenCalledWith("");
|
|
1474
1438
|
expect(element.find("option").eq(1)[0].selected).toBe(true);
|
|
1475
1439
|
expect(element.find("option").eq(1).text()).toBe("Option 2");
|
|
@@ -1486,14 +1450,12 @@ describe("select", () => {
|
|
|
1486
1450
|
"</select>",
|
|
1487
1451
|
);
|
|
1488
1452
|
|
|
1489
|
-
scope.$digest();
|
|
1490
1453
|
expect(scope.selected).toBeUndefined();
|
|
1491
1454
|
|
|
1492
1455
|
setSelectValue(element, 0);
|
|
1493
1456
|
expect(scope.selected).toBe("Option 1");
|
|
1494
1457
|
|
|
1495
1458
|
scope.selected = "Option 2";
|
|
1496
|
-
scope.$digest();
|
|
1497
1459
|
expect(element.find("option").eq(1)[0].selected).toBe(true);
|
|
1498
1460
|
expect(element.find("option").eq(1).text()).toBe("Option 2");
|
|
1499
1461
|
});
|
|
@@ -1512,15 +1474,12 @@ describe("select", () => {
|
|
|
1512
1474
|
const selectCtrl = element.controller("select");
|
|
1513
1475
|
spyOn(selectCtrl, "removeOption").and.callThrough();
|
|
1514
1476
|
|
|
1515
|
-
scope.$digest();
|
|
1516
1477
|
expect(scope.selected).toBeUndefined();
|
|
1517
1478
|
expect(selectCtrl.removeOption).not.toHaveBeenCalled();
|
|
1518
1479
|
|
|
1519
1480
|
// Change value of option2
|
|
1520
1481
|
scope.option2 = "Option 2 Changed";
|
|
1521
1482
|
scope.selected = "Option 2 Changed";
|
|
1522
|
-
scope.$digest();
|
|
1523
|
-
|
|
1524
1483
|
expect(selectCtrl.removeOption).toHaveBeenCalledWith("");
|
|
1525
1484
|
expect(element.find("option").eq(1)[0].selected).toBe(true);
|
|
1526
1485
|
expect(element.find("option").eq(1).text()).toBe("Option 2 Changed");
|
|
@@ -1535,7 +1494,6 @@ describe("select", () => {
|
|
|
1535
1494
|
)($rootScope);
|
|
1536
1495
|
|
|
1537
1496
|
$rootScope.foo = "success";
|
|
1538
|
-
$rootScope.$digest();
|
|
1539
1497
|
expect(element.find("span").text()).toBe("success");
|
|
1540
1498
|
dealoc(element);
|
|
1541
1499
|
});
|
|
@@ -1574,18 +1532,13 @@ describe("select", () => {
|
|
|
1574
1532
|
"</select>",
|
|
1575
1533
|
);
|
|
1576
1534
|
|
|
1577
|
-
scope.$digest();
|
|
1578
1535
|
expect(element.find("option").eq(0).val()).toBe("? string:NOMATCH ?");
|
|
1579
1536
|
|
|
1580
1537
|
scope.selected = prop;
|
|
1581
|
-
scope.$digest();
|
|
1582
|
-
|
|
1583
1538
|
expect(element.find("option").eq(0).val()).toBe(hashKey(prop));
|
|
1584
1539
|
|
|
1585
1540
|
// Reset
|
|
1586
1541
|
scope.selected = false;
|
|
1587
|
-
scope.$digest();
|
|
1588
|
-
|
|
1589
1542
|
expect(element.find("option").eq(0).val()).toBe("? boolean:false ?");
|
|
1590
1543
|
|
|
1591
1544
|
setSelectValue(element, 0);
|
|
@@ -1622,19 +1575,14 @@ describe("select", () => {
|
|
|
1622
1575
|
const selectController = element.controller("select");
|
|
1623
1576
|
spyOn(selectController, "removeOption").and.callThrough();
|
|
1624
1577
|
|
|
1625
|
-
scope.$digest();
|
|
1626
1578
|
expect(selectController.removeOption).not.toHaveBeenCalled();
|
|
1627
1579
|
expect(element.find("option").eq(0).val()).toBe("? string:NOMATCH ?");
|
|
1628
1580
|
|
|
1629
1581
|
scope.selected = prop;
|
|
1630
|
-
scope.$digest();
|
|
1631
|
-
|
|
1632
1582
|
expect(element.find("option").eq(0).val()).toBe(hashKey(prop));
|
|
1633
1583
|
expect(element[0].selectedIndex).toBe(0);
|
|
1634
1584
|
|
|
1635
1585
|
scope.option = "UPDATEDVALUE";
|
|
1636
|
-
scope.$digest();
|
|
1637
|
-
|
|
1638
1586
|
expect(selectController.removeOption.calls.count()).toBe(1);
|
|
1639
1587
|
|
|
1640
1588
|
// Updating the option value currently does not update the select model
|
|
@@ -1657,8 +1605,6 @@ describe("select", () => {
|
|
|
1657
1605
|
);
|
|
1658
1606
|
|
|
1659
1607
|
scope.selected = "UPDATEDVALUE";
|
|
1660
|
-
scope.$digest();
|
|
1661
|
-
|
|
1662
1608
|
expect(element[0].selectedIndex).toBe(0);
|
|
1663
1609
|
expect(element.find("option").eq(0).val()).toBe(
|
|
1664
1610
|
"string:UPDATEDVALUE",
|
|
@@ -1681,8 +1627,6 @@ describe("select", () => {
|
|
|
1681
1627
|
});
|
|
1682
1628
|
|
|
1683
1629
|
scope.option = "init";
|
|
1684
|
-
scope.$digest();
|
|
1685
|
-
|
|
1686
1630
|
expect(log[0]).toBe("init");
|
|
1687
1631
|
expect(element.find("option").eq(1).val()).toBe("string:init");
|
|
1688
1632
|
|
|
@@ -1752,8 +1696,6 @@ describe("select", () => {
|
|
|
1752
1696
|
"</select>",
|
|
1753
1697
|
);
|
|
1754
1698
|
|
|
1755
|
-
scope.$digest();
|
|
1756
|
-
|
|
1757
1699
|
expect(
|
|
1758
1700
|
Object.values(element[0].childNodes)
|
|
1759
1701
|
.map((x) => x.value)
|
|
@@ -1770,8 +1712,6 @@ describe("select", () => {
|
|
|
1770
1712
|
);
|
|
1771
1713
|
|
|
1772
1714
|
scope.selected = ["string", 1];
|
|
1773
|
-
scope.$digest();
|
|
1774
|
-
|
|
1775
1715
|
expect(element.find("option").eq(0)[0].selected).toBe(true);
|
|
1776
1716
|
expect(element.find("option").eq(2)[0].selected).toBe(true);
|
|
1777
1717
|
|
|
@@ -1781,12 +1721,11 @@ describe("select", () => {
|
|
|
1781
1721
|
// reset
|
|
1782
1722
|
scope.selected = [];
|
|
1783
1723
|
scope.$digest();
|
|
1724
|
+
let elems = element.find("option");
|
|
1784
1725
|
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
});
|
|
1789
|
-
|
|
1726
|
+
for (var i = 0; i < elems.length; i++) {
|
|
1727
|
+
JQLite(elems[i])[0].selected = true;
|
|
1728
|
+
}
|
|
1790
1729
|
browserTrigger(element, "change");
|
|
1791
1730
|
|
|
1792
1731
|
const arrayVal = ["a"];
|
|
@@ -1842,8 +1781,6 @@ describe("select", () => {
|
|
|
1842
1781
|
expect(scope.obj.value).toBe(prop === "ngValue" ? A : "A");
|
|
1843
1782
|
|
|
1844
1783
|
scope.options.shift();
|
|
1845
|
-
scope.$digest();
|
|
1846
|
-
|
|
1847
1784
|
optionElements = element.find("option");
|
|
1848
1785
|
expect(optionElements.length).toEqual(3);
|
|
1849
1786
|
expect(scope.obj.value).toBe(null);
|
|
@@ -1886,8 +1823,6 @@ describe("select", () => {
|
|
|
1886
1823
|
expect(scope.obj.value).toBe("A");
|
|
1887
1824
|
|
|
1888
1825
|
A.name = "X";
|
|
1889
|
-
scope.$digest();
|
|
1890
|
-
|
|
1891
1826
|
optionElements = element.find("option");
|
|
1892
1827
|
expect(optionElements.length).toEqual(4);
|
|
1893
1828
|
expect(scope.obj.value).toBe(null);
|
|
@@ -1930,8 +1865,6 @@ describe("select", () => {
|
|
|
1930
1865
|
expect(scope.obj.value).toBe("A");
|
|
1931
1866
|
|
|
1932
1867
|
A.disabled = true;
|
|
1933
|
-
scope.$digest();
|
|
1934
|
-
|
|
1935
1868
|
optionElements = element.find("option");
|
|
1936
1869
|
expect(optionElements.length).toEqual(4);
|
|
1937
1870
|
expect(scope.obj.value).toBe(null);
|
|
@@ -1970,15 +1903,11 @@ describe("select", () => {
|
|
|
1970
1903
|
expect(optionElements[0].value).toEqual(unknownValue(undefined));
|
|
1971
1904
|
|
|
1972
1905
|
B.disabled = true;
|
|
1973
|
-
scope.$digest();
|
|
1974
|
-
|
|
1975
1906
|
optionElements = element.find("option");
|
|
1976
1907
|
expect(optionElements.length).toEqual(4);
|
|
1977
1908
|
expect(optionElements[0].value).toEqual(unknownValue(undefined));
|
|
1978
1909
|
|
|
1979
1910
|
scope.obj.value = "B";
|
|
1980
|
-
scope.$digest();
|
|
1981
|
-
|
|
1982
1911
|
optionElements = element.find("option");
|
|
1983
1912
|
expect(optionElements.length).toEqual(3);
|
|
1984
1913
|
expect(scope.obj.value).toBe("B");
|
|
@@ -2024,16 +1953,12 @@ describe("select", () => {
|
|
|
2024
1953
|
expect(scope.obj.value).toBe("A");
|
|
2025
1954
|
|
|
2026
1955
|
A.disabled = true;
|
|
2027
|
-
scope.$digest();
|
|
2028
|
-
|
|
2029
1956
|
optionElements = element.find("option");
|
|
2030
1957
|
expect(optionElements.length).toEqual(4);
|
|
2031
1958
|
expect(scope.obj.value).toBe(null);
|
|
2032
1959
|
expect(element.val()).toBe("? object:null ?");
|
|
2033
1960
|
|
|
2034
1961
|
A.disabled = false;
|
|
2035
|
-
scope.$digest();
|
|
2036
|
-
|
|
2037
1962
|
optionElements = element.find("option");
|
|
2038
1963
|
expect(optionElements.length).toEqual(4);
|
|
2039
1964
|
expect(scope.obj.value).toBe(null);
|
|
@@ -2073,8 +1998,6 @@ describe("select", () => {
|
|
|
2073
1998
|
expect(optionElements.length).toEqual(3);
|
|
2074
1999
|
|
|
2075
2000
|
scope.options.push(C);
|
|
2076
|
-
scope.$digest();
|
|
2077
|
-
|
|
2078
2001
|
optionElements = element.find("option");
|
|
2079
2002
|
expect(optionElements.length).toEqual(3);
|
|
2080
2003
|
expect(optionElements[2].selected).toBe(true);
|
|
@@ -2113,8 +2036,6 @@ describe("select", () => {
|
|
|
2113
2036
|
expect(optionElements.length).toEqual(3);
|
|
2114
2037
|
|
|
2115
2038
|
scope.obj.value = "C";
|
|
2116
|
-
scope.$digest();
|
|
2117
|
-
|
|
2118
2039
|
optionElements = element.find("option");
|
|
2119
2040
|
expect(element.val()).toBe(prop === "ngValue" ? "string:C" : "C");
|
|
2120
2041
|
expect(optionElements.length).toEqual(3);
|
|
@@ -2122,8 +2043,6 @@ describe("select", () => {
|
|
|
2122
2043
|
expect(scope.obj.value).toBe("C");
|
|
2123
2044
|
|
|
2124
2045
|
scope.options = [{ name: "A" }, { name: "B" }, { name: "C" }];
|
|
2125
|
-
scope.$digest();
|
|
2126
|
-
|
|
2127
2046
|
optionElements = element.find("option");
|
|
2128
2047
|
expect(element.val()).toBe(prop === "ngValue" ? "string:C" : "C");
|
|
2129
2048
|
expect(optionElements.length).toEqual(3);
|
|
@@ -2182,8 +2101,6 @@ describe("select", () => {
|
|
|
2182
2101
|
ngModelCtrlSpy.calls.reset();
|
|
2183
2102
|
scope.options.shift();
|
|
2184
2103
|
scope.options.pop();
|
|
2185
|
-
scope.$digest();
|
|
2186
|
-
|
|
2187
2104
|
optionElements = element.find("option");
|
|
2188
2105
|
expect(optionElements.length).toEqual(1);
|
|
2189
2106
|
expect(scope.obj.value).toEqual([]);
|
|
@@ -2247,8 +2164,6 @@ describe("select", () => {
|
|
|
2247
2164
|
ngModelCtrlSpy.calls.reset();
|
|
2248
2165
|
A.name = "X";
|
|
2249
2166
|
C.name = "Z";
|
|
2250
|
-
scope.$digest();
|
|
2251
|
-
|
|
2252
2167
|
optionElements = element.find("option");
|
|
2253
2168
|
expect(optionElements.length).toEqual(3);
|
|
2254
2169
|
expect(scope.obj.value).toEqual([]);
|
|
@@ -2314,8 +2229,6 @@ describe("select", () => {
|
|
|
2314
2229
|
ngModelCtrlSpy.calls.reset();
|
|
2315
2230
|
A.disabled = true;
|
|
2316
2231
|
C.disabled = true;
|
|
2317
|
-
scope.$digest();
|
|
2318
|
-
|
|
2319
2232
|
optionElements = element.find("option");
|
|
2320
2233
|
expect(optionElements.length).toEqual(4);
|
|
2321
2234
|
expect(scope.obj.value).toEqual(["D"]);
|
|
@@ -2361,15 +2274,11 @@ describe("select", () => {
|
|
|
2361
2274
|
|
|
2362
2275
|
A.disabled = true;
|
|
2363
2276
|
D.disabled = true;
|
|
2364
|
-
scope.$digest();
|
|
2365
|
-
|
|
2366
2277
|
optionElements = element.find("option");
|
|
2367
2278
|
expect(optionElements.length).toEqual(4);
|
|
2368
2279
|
expect(element[0].value).toBe("");
|
|
2369
2280
|
|
|
2370
2281
|
scope.obj.value = prop === "ngValue" ? [A, C, D] : ["A", "C", "D"];
|
|
2371
|
-
scope.$digest();
|
|
2372
|
-
|
|
2373
2282
|
optionElements = element.find("option");
|
|
2374
2283
|
expect(optionElements.length).toEqual(4);
|
|
2375
2284
|
expect(optionElements.eq(0)[0].selected).toBe(true);
|
|
@@ -2413,8 +2322,6 @@ describe("select", () => {
|
|
|
2413
2322
|
expect(optionElements.eq(1)[0].selected).toBe(true);
|
|
2414
2323
|
|
|
2415
2324
|
scope.options.push(C);
|
|
2416
|
-
scope.$digest();
|
|
2417
|
-
|
|
2418
2325
|
optionElements = element.find("option");
|
|
2419
2326
|
|
|
2420
2327
|
expect(optionElements.length).toEqual(3);
|
|
@@ -2457,8 +2364,6 @@ describe("select", () => {
|
|
|
2457
2364
|
expect(optionElements.length).toEqual(3);
|
|
2458
2365
|
|
|
2459
2366
|
scope.obj.value = ["B", "C"];
|
|
2460
|
-
scope.$digest();
|
|
2461
|
-
|
|
2462
2367
|
optionElements = element.find("option");
|
|
2463
2368
|
|
|
2464
2369
|
expect(optionElements.length).toEqual(3);
|
|
@@ -2467,8 +2372,6 @@ describe("select", () => {
|
|
|
2467
2372
|
expect(scope.obj.value).toEqual(["B", "C"]);
|
|
2468
2373
|
|
|
2469
2374
|
scope.options = [{ name: "A" }, { name: "B" }, { name: "C" }];
|
|
2470
|
-
scope.$digest();
|
|
2471
|
-
|
|
2472
2375
|
optionElements = element.find("option");
|
|
2473
2376
|
|
|
2474
2377
|
expect(optionElements.length).toEqual(3);
|
|
@@ -22,7 +22,7 @@ export function ngShowDirective($animate) {
|
|
|
22
22
|
tempClasses: NG_HIDE_IN_PROGRESS_CLASS,
|
|
23
23
|
});
|
|
24
24
|
} else {
|
|
25
|
-
scope
|
|
25
|
+
scope.$postUpdate(() => {
|
|
26
26
|
if (value) {
|
|
27
27
|
element
|
|
28
28
|
.elements()
|
|
@@ -56,7 +56,7 @@ export function ngHideDirective($animate) {
|
|
|
56
56
|
tempClasses: NG_HIDE_IN_PROGRESS_CLASS,
|
|
57
57
|
});
|
|
58
58
|
} else {
|
|
59
|
-
scope
|
|
59
|
+
scope.$postUpdate(() => {
|
|
60
60
|
if (value) {
|
|
61
61
|
element
|
|
62
62
|
.elements()
|