@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
|
@@ -2,7 +2,6 @@ import { Angular } from "../../loader";
|
|
|
2
2
|
import { createInjector } from "../di/injector";
|
|
3
3
|
import { dealoc, JQLite, getOrSetCacheData } from "../../shared/jqlite/jqlite";
|
|
4
4
|
import {
|
|
5
|
-
forEach,
|
|
6
5
|
isFunction,
|
|
7
6
|
valueFn,
|
|
8
7
|
isElement,
|
|
@@ -435,42 +434,36 @@ describe("$compile", () => {
|
|
|
435
434
|
expect(el.data("hasCompiled")).toBe(true);
|
|
436
435
|
});
|
|
437
436
|
|
|
438
|
-
|
|
439
|
-
{
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
});
|
|
464
|
-
reloadModules();
|
|
465
|
-
$compile(dom);
|
|
466
|
-
expect(hasCompiled).toBe(expected[type]);
|
|
467
|
-
},
|
|
468
|
-
);
|
|
437
|
+
Object.entries({
|
|
438
|
+
E: { element: true, attribute: false },
|
|
439
|
+
A: { element: false, attribute: true },
|
|
440
|
+
EA: { element: true, attribute: true },
|
|
441
|
+
}).forEach(([restrict, expected]) => {
|
|
442
|
+
describe("restricted to " + restrict, () => {
|
|
443
|
+
Object.entries({
|
|
444
|
+
element: "<my-directive></my-directive>",
|
|
445
|
+
attribute: "<div my-directive></div>",
|
|
446
|
+
}).forEach(([type, dom]) => {
|
|
447
|
+
it(
|
|
448
|
+
(expected[type] ? "matches" : "does not match") + " on " + type,
|
|
449
|
+
() => {
|
|
450
|
+
var hasCompiled = false;
|
|
451
|
+
myModule.directive("myDirective", () => {
|
|
452
|
+
return {
|
|
453
|
+
restrict: restrict,
|
|
454
|
+
compile: () => {
|
|
455
|
+
hasCompiled = true;
|
|
456
|
+
},
|
|
457
|
+
};
|
|
458
|
+
});
|
|
459
|
+
reloadModules();
|
|
460
|
+
$compile(dom);
|
|
461
|
+
expect(hasCompiled).toBe(expected[type]);
|
|
469
462
|
},
|
|
470
463
|
);
|
|
471
464
|
});
|
|
472
|
-
}
|
|
473
|
-
);
|
|
465
|
+
});
|
|
466
|
+
});
|
|
474
467
|
|
|
475
468
|
it("applies to attributes when no restrict given", () => {
|
|
476
469
|
var hasCompiled = false;
|
|
@@ -748,7 +741,6 @@ describe("$compile", () => {
|
|
|
748
741
|
// According to spec SVG element className property is readonly, but only FF
|
|
749
742
|
// implements it this way which causes compile exceptions.
|
|
750
743
|
element = $compile("<svg><text>{{1}}</text></svg>")($rootScope);
|
|
751
|
-
$rootScope.$digest();
|
|
752
744
|
expect(element.text()).toEqual("1");
|
|
753
745
|
});
|
|
754
746
|
|
|
@@ -1019,8 +1011,6 @@ describe("$compile", () => {
|
|
|
1019
1011
|
gotValue = value;
|
|
1020
1012
|
});
|
|
1021
1013
|
|
|
1022
|
-
$rootScope.$digest();
|
|
1023
|
-
|
|
1024
1014
|
expect(gotValue).toEqual("42");
|
|
1025
1015
|
},
|
|
1026
1016
|
);
|
|
@@ -1062,7 +1052,6 @@ describe("$compile", () => {
|
|
|
1062
1052
|
"<my-directive></my-directive>",
|
|
1063
1053
|
function (element, attrs) {
|
|
1064
1054
|
attrs.$addClass("some-class");
|
|
1065
|
-
$rootScope.$digest();
|
|
1066
1055
|
expect(element[0].classList.contains("some-class")).toBe(true);
|
|
1067
1056
|
},
|
|
1068
1057
|
);
|
|
@@ -1074,7 +1063,6 @@ describe("$compile", () => {
|
|
|
1074
1063
|
'<my-directive class="some-class"></my-directive>',
|
|
1075
1064
|
function (element, attrs) {
|
|
1076
1065
|
attrs.$removeClass("some-class");
|
|
1077
|
-
$rootScope.$digest();
|
|
1078
1066
|
expect(element[0].classList.contains("some-class")).toBe(false);
|
|
1079
1067
|
},
|
|
1080
1068
|
);
|
|
@@ -1086,7 +1074,6 @@ describe("$compile", () => {
|
|
|
1086
1074
|
'<my-directive class="one three four"></my-directive>',
|
|
1087
1075
|
function (element, attrs) {
|
|
1088
1076
|
attrs.$updateClass("one two three", "one three four");
|
|
1089
|
-
$rootScope.$digest();
|
|
1090
1077
|
expect(element[0].classList.contains("one")).toBe(true);
|
|
1091
1078
|
expect(element[0].classList.contains("two")).toBe(true);
|
|
1092
1079
|
expect(element[0].classList.contains("three")).toBe(true);
|
|
@@ -1603,7 +1590,6 @@ describe("$compile", () => {
|
|
|
1603
1590
|
$compile(el)($rootScope);
|
|
1604
1591
|
|
|
1605
1592
|
$rootScope.parentAttr = 41;
|
|
1606
|
-
$rootScope.$digest();
|
|
1607
1593
|
expect(givenScope.myAttr).toBe(42);
|
|
1608
1594
|
});
|
|
1609
1595
|
|
|
@@ -1680,7 +1666,6 @@ describe("$compile", () => {
|
|
|
1680
1666
|
$compile(el)($rootScope);
|
|
1681
1667
|
|
|
1682
1668
|
$rootScope.parentAttr = 41;
|
|
1683
|
-
$rootScope.$digest();
|
|
1684
1669
|
expect(givenScope.myAttr).toBe(42);
|
|
1685
1670
|
});
|
|
1686
1671
|
|
|
@@ -1716,7 +1701,6 @@ describe("$compile", () => {
|
|
|
1716
1701
|
$compile(el)($rootScope);
|
|
1717
1702
|
|
|
1718
1703
|
isolateScope.myAttr = 42;
|
|
1719
|
-
$rootScope.$digest();
|
|
1720
1704
|
expect($rootScope.parentAttr).toBe(42);
|
|
1721
1705
|
});
|
|
1722
1706
|
|
|
@@ -1738,7 +1722,6 @@ describe("$compile", () => {
|
|
|
1738
1722
|
|
|
1739
1723
|
$rootScope.parentAttr = 42;
|
|
1740
1724
|
isolateScope.myAttr = 43;
|
|
1741
|
-
$rootScope.$digest();
|
|
1742
1725
|
expect($rootScope.parentAttr).toBe(42);
|
|
1743
1726
|
expect(isolateScope.myAttr).toBe(42);
|
|
1744
1727
|
});
|
|
@@ -1761,9 +1744,7 @@ describe("$compile", () => {
|
|
|
1761
1744
|
};
|
|
1762
1745
|
var el = $('<div my-directive my-attr="parentFunction()"></div>');
|
|
1763
1746
|
$compile(el)($rootScope);
|
|
1764
|
-
expect(() => {
|
|
1765
|
-
$rootScope.$digest();
|
|
1766
|
-
}).toThrowError();
|
|
1747
|
+
expect(() => {}).toThrowError();
|
|
1767
1748
|
});
|
|
1768
1749
|
|
|
1769
1750
|
it("can watch two-way bindings as collections", () => {
|
|
@@ -1784,7 +1765,6 @@ describe("$compile", () => {
|
|
|
1784
1765
|
};
|
|
1785
1766
|
var el = $('<div my-directive my-attr="parentFunction()"></div>');
|
|
1786
1767
|
$compile(el)($rootScope);
|
|
1787
|
-
$rootScope.$digest();
|
|
1788
1768
|
expect(givenScope.myAttr).toEqual([1, 2, 3]);
|
|
1789
1769
|
});
|
|
1790
1770
|
|
|
@@ -2047,8 +2027,6 @@ describe("$compile", () => {
|
|
|
2047
2027
|
var el = $('<div my-directive="abc"></div>');
|
|
2048
2028
|
|
|
2049
2029
|
$compile(el)($rootScope);
|
|
2050
|
-
$rootScope.$digest();
|
|
2051
|
-
|
|
2052
2030
|
expect(ctl.myAttr).toEqual("abc");
|
|
2053
2031
|
});
|
|
2054
2032
|
|
|
@@ -4763,8 +4741,6 @@ describe("$compile", () => {
|
|
|
4763
4741
|
$compile("<fff></fff>")($rootScope);
|
|
4764
4742
|
$compile("<ffff></ffff>")($rootScope);
|
|
4765
4743
|
$compile("<fffff></fffff>")($rootScope);
|
|
4766
|
-
$rootScope.$digest();
|
|
4767
|
-
|
|
4768
4744
|
expect(log.join("; ")).toEqual(
|
|
4769
4745
|
"ff template: true; " +
|
|
4770
4746
|
"ff compile: true; " +
|
|
@@ -4974,7 +4950,6 @@ describe("$compile", () => {
|
|
|
4974
4950
|
$rootScope.name = "Lucas";
|
|
4975
4951
|
$rootScope.color = "blue";
|
|
4976
4952
|
$compile(element[0].childNodes)($rootScope);
|
|
4977
|
-
$rootScope.$digest();
|
|
4978
4953
|
expect(element.text()).toEqual("Name: Lucas\nColor: blue");
|
|
4979
4954
|
});
|
|
4980
4955
|
|
|
@@ -5047,7 +5022,6 @@ describe("$compile", () => {
|
|
|
5047
5022
|
);
|
|
5048
5023
|
|
|
5049
5024
|
$compile(element[0].childNodes)($rootScope);
|
|
5050
|
-
$rootScope.$digest();
|
|
5051
5025
|
document.body.appendChild(element[0]);
|
|
5052
5026
|
expect(element.find("span").text()).toContain("Should render");
|
|
5053
5027
|
});
|
|
@@ -5082,7 +5056,6 @@ describe("$compile", () => {
|
|
|
5082
5056
|
'<div><div ng-repeat="i in [1,2]"><div after>A</div></div></div>',
|
|
5083
5057
|
);
|
|
5084
5058
|
$compile(element)($rootScope);
|
|
5085
|
-
$rootScope.$digest();
|
|
5086
5059
|
expect(element.text()).toBe("ABAB");
|
|
5087
5060
|
});
|
|
5088
5061
|
|
|
@@ -5099,7 +5072,6 @@ describe("$compile", () => {
|
|
|
5099
5072
|
element = JQLite("<div><div remove-node></div><div>{{test}}</div></div>");
|
|
5100
5073
|
$rootScope.test = "Hello";
|
|
5101
5074
|
$compile(element)($rootScope);
|
|
5102
|
-
$rootScope.$digest();
|
|
5103
5075
|
expect(element.children().length).toBe(1);
|
|
5104
5076
|
expect(element.text()).toBe("Hello");
|
|
5105
5077
|
});
|
|
@@ -5182,14 +5154,16 @@ describe("$compile", () => {
|
|
|
5182
5154
|
|
|
5183
5155
|
describe("restrict", () => {
|
|
5184
5156
|
it("should allow restriction of availability", () => {
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5157
|
+
Object.entries({ div: "E", attr: "A", all: "EA" }).forEach(
|
|
5158
|
+
([name, restrict]) => {
|
|
5159
|
+
myModule.directive(name, () => ({
|
|
5160
|
+
restrict,
|
|
5161
|
+
compile: valueFn((scope, element, attr) => {
|
|
5162
|
+
log.push(name);
|
|
5163
|
+
}),
|
|
5164
|
+
}));
|
|
5165
|
+
},
|
|
5166
|
+
);
|
|
5193
5167
|
|
|
5194
5168
|
reloadModules();
|
|
5195
5169
|
dealoc($compile('<span div class="div"></span>')($rootScope));
|
|
@@ -5373,14 +5347,12 @@ describe("$compile", () => {
|
|
|
5373
5347
|
it("should compile template when replacing", () => {
|
|
5374
5348
|
reloadModules();
|
|
5375
5349
|
element = $compile("<div><div replace>ignore</div><div>")($rootScope);
|
|
5376
|
-
$rootScope.$digest();
|
|
5377
5350
|
expect(element.text()).toEqual("Replace!");
|
|
5378
5351
|
});
|
|
5379
5352
|
|
|
5380
5353
|
it("should compile template when appending", () => {
|
|
5381
5354
|
reloadModules();
|
|
5382
5355
|
element = $compile("<div><div append>ignore</div><div>")($rootScope);
|
|
5383
|
-
$rootScope.$digest();
|
|
5384
5356
|
expect(element.text()).toEqual("Append!");
|
|
5385
5357
|
});
|
|
5386
5358
|
|
|
@@ -5445,7 +5417,6 @@ describe("$compile", () => {
|
|
|
5445
5417
|
element = $compile(
|
|
5446
5418
|
"<div>" + '<div ng-repeat="i in [1,2]" replace></div>' + "</div>",
|
|
5447
5419
|
)($rootScope);
|
|
5448
|
-
$rootScope.$digest();
|
|
5449
5420
|
expect(element.text()).toEqual("Replace!Replace!");
|
|
5450
5421
|
});
|
|
5451
5422
|
|
|
@@ -5454,7 +5425,6 @@ describe("$compile", () => {
|
|
|
5454
5425
|
element = $compile(
|
|
5455
5426
|
"<div>" + '<div ng-repeat="i in [1,2]" append></div>' + "</div>",
|
|
5456
5427
|
)($rootScope);
|
|
5457
|
-
$rootScope.$digest();
|
|
5458
5428
|
expect(element.text()).toEqual("Append!Append!");
|
|
5459
5429
|
});
|
|
5460
5430
|
|
|
@@ -5463,7 +5433,6 @@ describe("$compile", () => {
|
|
|
5463
5433
|
element = $compile("<div replace-with-interpolated-class></div>")(
|
|
5464
5434
|
$rootScope,
|
|
5465
5435
|
);
|
|
5466
|
-
$rootScope.$digest();
|
|
5467
5436
|
expect(element[0].classList.contains("class_2")).toBeTrue();
|
|
5468
5437
|
});
|
|
5469
5438
|
|
|
@@ -5510,7 +5479,6 @@ describe("$compile", () => {
|
|
|
5510
5479
|
element = $compile('<div>{{log("A")}} foo {{::log("B")}}</div>')(
|
|
5511
5480
|
$rootScope,
|
|
5512
5481
|
);
|
|
5513
|
-
$rootScope.$digest();
|
|
5514
5482
|
expect(log.join("; ")).toEqual("A; B; A; B");
|
|
5515
5483
|
});
|
|
5516
5484
|
|
|
@@ -5665,7 +5633,6 @@ describe("$compile", () => {
|
|
|
5665
5633
|
'<svg><g svg-anchor="/foo/bar" text="foo/bar!"></g></svg>',
|
|
5666
5634
|
)($rootScope);
|
|
5667
5635
|
const child = element.children().eq(0);
|
|
5668
|
-
$rootScope.$digest();
|
|
5669
5636
|
expect(getNodeName(child)).toMatch(/a/i);
|
|
5670
5637
|
expect(isSVGElement(child[0])).toBe(true);
|
|
5671
5638
|
expect(child[0].href.baseVal).toBe("/foo/bar");
|
|
@@ -5693,7 +5660,6 @@ describe("$compile", () => {
|
|
|
5693
5660
|
element = $compile('<math><mn pow="2"><mn>8</mn></mn></math>')(
|
|
5694
5661
|
$rootScope,
|
|
5695
5662
|
);
|
|
5696
|
-
$rootScope.$digest();
|
|
5697
5663
|
const child = element.children().eq(0);
|
|
5698
5664
|
expect(getNodeName(child)).toMatch(/msup/i);
|
|
5699
5665
|
expect(isUnknownElement(child[0])).toBe(false);
|
|
@@ -5720,7 +5686,6 @@ describe("$compile", () => {
|
|
|
5720
5686
|
element = $compile(
|
|
5721
5687
|
"<template-url-with-prototype><template-url-with-prototype>",
|
|
5722
5688
|
)($rootScope);
|
|
5723
|
-
$rootScope.$digest();
|
|
5724
5689
|
expect(element.find("p")[0].innerHTML).toEqual("Test Value");
|
|
5725
5690
|
});
|
|
5726
5691
|
});
|
|
@@ -5954,7 +5919,6 @@ describe("$compile", () => {
|
|
|
5954
5919
|
expect(element[0].outerHTML).toEqual(
|
|
5955
5920
|
'<div cross-domain-template=""></div>',
|
|
5956
5921
|
);
|
|
5957
|
-
$rootScope.$digest();
|
|
5958
5922
|
expect(element[0].outerHTML).toEqual(
|
|
5959
5923
|
'<div cross-domain-template=""><span>example.com/cached-version</span></div>',
|
|
5960
5924
|
);
|
|
@@ -5963,7 +5927,6 @@ describe("$compile", () => {
|
|
|
5963
5927
|
it("should load cross domain templates when trusted", (done) => {
|
|
5964
5928
|
element = $compile("<div trusted-template></div>")($rootScope);
|
|
5965
5929
|
expect(element[0].outerHTML).toEqual('<div trusted-template=""></div>');
|
|
5966
|
-
$rootScope.$digest();
|
|
5967
5930
|
setTimeout(() => {
|
|
5968
5931
|
expect(element[0].outerHTML).toEqual(
|
|
5969
5932
|
'<div trusted-template="">Hello</div>',
|
|
@@ -5981,8 +5944,6 @@ describe("$compile", () => {
|
|
|
5981
5944
|
'<div><b hello=""></b><b cau=""></b></div>',
|
|
5982
5945
|
);
|
|
5983
5946
|
|
|
5984
|
-
$rootScope.$digest();
|
|
5985
|
-
|
|
5986
5947
|
expect(element[0].outerHTML).toEqual(
|
|
5987
5948
|
'<div><b hello=""></b><b cau=""><span>Cau!</span></b></div>',
|
|
5988
5949
|
);
|
|
@@ -6004,8 +5965,6 @@ describe("$compile", () => {
|
|
|
6004
5965
|
'<div><b i-hello=""></b><b i-cau=""></b></div>',
|
|
6005
5966
|
);
|
|
6006
5967
|
|
|
6007
|
-
$rootScope.$digest();
|
|
6008
|
-
|
|
6009
5968
|
expect(element[0].outerHTML).toBe(
|
|
6010
5969
|
'<div><b i-hello=""></b><span i-cau="">Cau!</span></div>',
|
|
6011
5970
|
);
|
|
@@ -6023,8 +5982,6 @@ describe("$compile", () => {
|
|
|
6023
5982
|
$rootScope.name = "Elvis";
|
|
6024
5983
|
element = $compile('<div><b hello=""></b></div>')($rootScope);
|
|
6025
5984
|
|
|
6026
|
-
$rootScope.$digest();
|
|
6027
|
-
|
|
6028
5985
|
setTimeout(() => {
|
|
6029
5986
|
expect(element[0].outerHTML).toEqual(
|
|
6030
5987
|
'<div><b hello=""><span>Hello, Elvis!</span></b></div>',
|
|
@@ -6038,8 +5995,6 @@ describe("$compile", () => {
|
|
|
6038
5995
|
$rootScope.name = "Elvis";
|
|
6039
5996
|
element = $compile("<div><b i-hello></b></div>")($rootScope);
|
|
6040
5997
|
|
|
6041
|
-
$rootScope.$digest();
|
|
6042
|
-
|
|
6043
5998
|
expect(element[0].outerHTML).toBe(
|
|
6044
5999
|
'<div><span i-hello="">Hello, Elvis!</span></div>',
|
|
6045
6000
|
);
|
|
@@ -6050,8 +6005,6 @@ describe("$compile", () => {
|
|
|
6050
6005
|
$rootScope.name = "Elvis";
|
|
6051
6006
|
element = $compile('<div><b hello=""></b></div>')($rootScope);
|
|
6052
6007
|
|
|
6053
|
-
$rootScope.$digest();
|
|
6054
|
-
|
|
6055
6008
|
expect(element[0].outerHTML).toEqual(
|
|
6056
6009
|
'<div><b hello=""><span replace="">Hello, Elvis!</span></b></div>',
|
|
6057
6010
|
);
|
|
@@ -6061,8 +6014,6 @@ describe("$compile", () => {
|
|
|
6061
6014
|
$rootScope.name = "Elvis";
|
|
6062
6015
|
element = $compile("<div replace></div>")($rootScope);
|
|
6063
6016
|
|
|
6064
|
-
$rootScope.$digest();
|
|
6065
|
-
|
|
6066
6017
|
expect(element[0].outerHTML).toEqual(
|
|
6067
6018
|
'<span replace="">Hello, Elvis!</span>',
|
|
6068
6019
|
);
|
|
@@ -6085,11 +6036,10 @@ describe("$compile", () => {
|
|
|
6085
6036
|
|
|
6086
6037
|
e1 = template($rootScope.$new(), () => {}); // clone
|
|
6087
6038
|
expect(e1.text()).toEqual("");
|
|
6088
|
-
//
|
|
6039
|
+
// ;
|
|
6089
6040
|
setTimeout(() => {
|
|
6090
6041
|
e2 = template($rootScope.$new(), () => {}); // clone
|
|
6091
6042
|
//
|
|
6092
|
-
$rootScope.$digest();
|
|
6093
6043
|
expect(e1.text()).toEqual("HelloElvis ");
|
|
6094
6044
|
expect(e2.text()).toEqual("HelloElvis ");
|
|
6095
6045
|
|
|
@@ -6114,7 +6064,6 @@ describe("$compile", () => {
|
|
|
6114
6064
|
|
|
6115
6065
|
await wait(100);
|
|
6116
6066
|
e2 = template($rootScope.$new(), () => {}); // clone
|
|
6117
|
-
$rootScope.$digest();
|
|
6118
6067
|
expect(e1.text()).toEqual("Elvis");
|
|
6119
6068
|
expect(e2.text()).toEqual("Elvis");
|
|
6120
6069
|
|
|
@@ -6142,7 +6091,6 @@ describe("$compile", () => {
|
|
|
6142
6091
|
|
|
6143
6092
|
await wait(100);
|
|
6144
6093
|
e2 = template($rootScope.$new(), () => {}); // clone
|
|
6145
|
-
$rootScope.$digest();
|
|
6146
6094
|
expect(e1.text()).toEqual("HelloElvis");
|
|
6147
6095
|
expect(e2.text()).toEqual("HelloElvis");
|
|
6148
6096
|
|
|
@@ -6162,7 +6110,6 @@ describe("$compile", () => {
|
|
|
6162
6110
|
|
|
6163
6111
|
e2 = template($rootScope.$new(), () => {}); // clone
|
|
6164
6112
|
|
|
6165
|
-
$rootScope.$digest();
|
|
6166
6113
|
setTimeout(() => {
|
|
6167
6114
|
expect(e1.text()).toEqual("Elvis");
|
|
6168
6115
|
expect(e2.text()).toEqual("Elvis");
|
|
@@ -6224,7 +6171,6 @@ describe("$compile", () => {
|
|
|
6224
6171
|
element = $compile("<div test></div>")($rootScope, (node) => {
|
|
6225
6172
|
node[0].classList.add("clonefn-class");
|
|
6226
6173
|
});
|
|
6227
|
-
$rootScope.$digest();
|
|
6228
6174
|
expect(element[0].classList.contains("template-class")).toBeTrue();
|
|
6229
6175
|
expect(element[0].classList.contains("clonefn-class")).toBeTrue();
|
|
6230
6176
|
});
|
|
@@ -6293,8 +6239,7 @@ describe("$compile", () => {
|
|
|
6293
6239
|
expect(log[0]).toEqual("first-C");
|
|
6294
6240
|
|
|
6295
6241
|
log.push("FLUSH");
|
|
6296
|
-
//
|
|
6297
|
-
$rootScope.$digest();
|
|
6242
|
+
// //;
|
|
6298
6243
|
expect(log.join("; ")).toEqual(
|
|
6299
6244
|
"first-C; FLUSH; second-C; last-C; third-C; " +
|
|
6300
6245
|
"first-PreL; second-PreL; last-PreL; third-PreL; " +
|
|
@@ -6319,7 +6264,6 @@ describe("$compile", () => {
|
|
|
6319
6264
|
expect(log[0]).toEqual("iFirst-C");
|
|
6320
6265
|
|
|
6321
6266
|
log.push("FLUSH");
|
|
6322
|
-
$rootScope.$digest();
|
|
6323
6267
|
expect(log.join("; ")).toEqual(
|
|
6324
6268
|
"iFirst-C; FLUSH; iSecond-C; iThird-C; iLast-C; " +
|
|
6325
6269
|
"iFirst-PreL; iSecond-PreL; iThird-PreL; iLast-PreL; " +
|
|
@@ -6343,7 +6287,6 @@ describe("$compile", () => {
|
|
|
6343
6287
|
//expect(log.join("; ")).toEqual("first-C; FLUSH; second-C; last-C; third-C");
|
|
6344
6288
|
|
|
6345
6289
|
element = template($rootScope);
|
|
6346
|
-
$rootScope.$digest();
|
|
6347
6290
|
expect(log.join("; ")).toEqual(
|
|
6348
6291
|
"first-C; FLUSH; second-C; last-C; third-C; " +
|
|
6349
6292
|
"first-PreL; second-PreL; last-PreL; third-PreL; " +
|
|
@@ -6367,7 +6310,6 @@ describe("$compile", () => {
|
|
|
6367
6310
|
expect(log[0]).toEqual("iFirst-C");
|
|
6368
6311
|
log.push("FLUSH");
|
|
6369
6312
|
element = template($rootScope);
|
|
6370
|
-
$rootScope.$digest();
|
|
6371
6313
|
expect(log.join("; ")).toEqual(
|
|
6372
6314
|
"iFirst-C; FLUSH; iSecond-C; iThird-C; iLast-C; " +
|
|
6373
6315
|
"iFirst-PreL; iSecond-PreL; iThird-PreL; iLast-PreL; " +
|
|
@@ -6386,7 +6328,6 @@ describe("$compile", () => {
|
|
|
6386
6328
|
it("should allow multiple elements in template", () => {
|
|
6387
6329
|
$templateCache.set("second.html", "before <b>mid</b> after");
|
|
6388
6330
|
element = $compile("<div second></div>")($rootScope);
|
|
6389
|
-
$rootScope.$digest();
|
|
6390
6331
|
expect(element.text()).toEqual("before mid after");
|
|
6391
6332
|
});
|
|
6392
6333
|
|
|
@@ -6397,7 +6338,6 @@ describe("$compile", () => {
|
|
|
6397
6338
|
);
|
|
6398
6339
|
element = JQLite('<b hello="">{{1+2}}</b>');
|
|
6399
6340
|
$compile(element)($rootScope);
|
|
6400
|
-
$rootScope.$digest();
|
|
6401
6341
|
expect(element.text()).toEqual("3==3");
|
|
6402
6342
|
});
|
|
6403
6343
|
|
|
@@ -6430,7 +6370,7 @@ describe("$compile", () => {
|
|
|
6430
6370
|
|
|
6431
6371
|
// expect(() => {
|
|
6432
6372
|
// $compile("<p template></p>")($rootScope);
|
|
6433
|
-
//
|
|
6373
|
+
// ;
|
|
6434
6374
|
// }).toThrowError(/tplrt/);
|
|
6435
6375
|
// });
|
|
6436
6376
|
|
|
@@ -6446,9 +6386,7 @@ describe("$compile", () => {
|
|
|
6446
6386
|
it("should not throw if the root element is accompanied by: whitespace", () => {
|
|
6447
6387
|
$templateCache.set("template.html", "<div>Hello World!</div> \n");
|
|
6448
6388
|
element = $compile("<p template></p>")($rootScope);
|
|
6449
|
-
expect(() => {
|
|
6450
|
-
$rootScope.$digest();
|
|
6451
|
-
}).not.toThrow();
|
|
6389
|
+
expect(() => {}).not.toThrow();
|
|
6452
6390
|
expect(element.length).toBe(1);
|
|
6453
6391
|
expect(element.text()).toBe("Hello World!");
|
|
6454
6392
|
});
|
|
@@ -6459,9 +6397,7 @@ describe("$compile", () => {
|
|
|
6459
6397
|
"<!-- oh hi --><div>Hello World!</div> \n",
|
|
6460
6398
|
);
|
|
6461
6399
|
element = $compile("<p template></p>")($rootScope);
|
|
6462
|
-
expect(() => {
|
|
6463
|
-
$rootScope.$digest();
|
|
6464
|
-
}).not.toThrow();
|
|
6400
|
+
expect(() => {}).not.toThrow();
|
|
6465
6401
|
expect(element.length).toBe(1);
|
|
6466
6402
|
expect(element.text()).toBe("Hello World!");
|
|
6467
6403
|
});
|
|
@@ -6472,9 +6408,7 @@ describe("$compile", () => {
|
|
|
6472
6408
|
" <!-- oh hi --> <div>Hello World!</div> <!-- oh hi -->\n",
|
|
6473
6409
|
);
|
|
6474
6410
|
element = $compile("<p template></p>")($rootScope);
|
|
6475
|
-
expect(() => {
|
|
6476
|
-
$rootScope.$digest();
|
|
6477
|
-
}).not.toThrow();
|
|
6411
|
+
expect(() => {}).not.toThrow();
|
|
6478
6412
|
expect(element.length).toBe(1);
|
|
6479
6413
|
expect(element.text()).toBe("Hello World!");
|
|
6480
6414
|
});
|
|
@@ -6552,7 +6486,6 @@ describe("$compile", () => {
|
|
|
6552
6486
|
expect(() => {
|
|
6553
6487
|
element = $compile("<div replace-with-tr></div>")($rootScope);
|
|
6554
6488
|
}).not.toThrow();
|
|
6555
|
-
$rootScope.$digest();
|
|
6556
6489
|
expect(getNodeName(element)).toMatch(/tr/i);
|
|
6557
6490
|
});
|
|
6558
6491
|
|
|
@@ -6561,7 +6494,6 @@ describe("$compile", () => {
|
|
|
6561
6494
|
expect(() => {
|
|
6562
6495
|
element = $compile("<div replace-with-td></div>")($rootScope);
|
|
6563
6496
|
}).not.toThrow();
|
|
6564
|
-
$rootScope.$digest();
|
|
6565
6497
|
expect(getNodeName(element)).toMatch(/td/i);
|
|
6566
6498
|
});
|
|
6567
6499
|
|
|
@@ -6570,7 +6502,6 @@ describe("$compile", () => {
|
|
|
6570
6502
|
expect(() => {
|
|
6571
6503
|
element = $compile("<div replace-with-th></div>")($rootScope);
|
|
6572
6504
|
}).not.toThrow();
|
|
6573
|
-
$rootScope.$digest();
|
|
6574
6505
|
expect(getNodeName(element)).toMatch(/th/i);
|
|
6575
6506
|
});
|
|
6576
6507
|
|
|
@@ -6579,7 +6510,6 @@ describe("$compile", () => {
|
|
|
6579
6510
|
expect(() => {
|
|
6580
6511
|
element = $compile("<div replace-with-thead></div>")($rootScope);
|
|
6581
6512
|
}).not.toThrow();
|
|
6582
|
-
$rootScope.$digest();
|
|
6583
6513
|
expect(getNodeName(element)).toMatch(/thead/i);
|
|
6584
6514
|
});
|
|
6585
6515
|
|
|
@@ -6588,7 +6518,6 @@ describe("$compile", () => {
|
|
|
6588
6518
|
expect(() => {
|
|
6589
6519
|
element = $compile("<div replace-with-tbody></div>")($rootScope);
|
|
6590
6520
|
}).not.toThrow();
|
|
6591
|
-
$rootScope.$digest();
|
|
6592
6521
|
expect(getNodeName(element)).toMatch(/tbody/i);
|
|
6593
6522
|
});
|
|
6594
6523
|
|
|
@@ -6597,7 +6526,6 @@ describe("$compile", () => {
|
|
|
6597
6526
|
expect(() => {
|
|
6598
6527
|
element = $compile("<div replace-with-tfoot></div>")($rootScope);
|
|
6599
6528
|
}).not.toThrow();
|
|
6600
|
-
$rootScope.$digest();
|
|
6601
6529
|
expect(getNodeName(element)).toMatch(/tfoot/i);
|
|
6602
6530
|
});
|
|
6603
6531
|
|
|
@@ -6606,7 +6534,6 @@ describe("$compile", () => {
|
|
|
6606
6534
|
expect(() => {
|
|
6607
6535
|
element = $compile("<div replace-with-option></div>")($rootScope);
|
|
6608
6536
|
}).not.toThrow();
|
|
6609
|
-
$rootScope.$digest();
|
|
6610
6537
|
expect(getNodeName(element)).toMatch(/option/i);
|
|
6611
6538
|
});
|
|
6612
6539
|
|
|
@@ -6615,7 +6542,6 @@ describe("$compile", () => {
|
|
|
6615
6542
|
expect(() => {
|
|
6616
6543
|
element = $compile("<div replace-with-optgroup></div>")($rootScope);
|
|
6617
6544
|
}).not.toThrow();
|
|
6618
|
-
$rootScope.$digest();
|
|
6619
6545
|
expect(getNodeName(element)).toMatch(/optgroup/i);
|
|
6620
6546
|
});
|
|
6621
6547
|
|
|
@@ -6641,7 +6567,6 @@ describe("$compile", () => {
|
|
|
6641
6567
|
element = $compile(
|
|
6642
6568
|
'<svg><g svg-anchor="/foo/bar" text="foo/bar!"></g></svg>',
|
|
6643
6569
|
)($rootScope);
|
|
6644
|
-
$rootScope.$digest();
|
|
6645
6570
|
const child = element.children().eq(0);
|
|
6646
6571
|
expect(getNodeName(child)).toMatch(/a/i);
|
|
6647
6572
|
expect(isSVGElement(child[0])).toBe(true);
|
|
@@ -6677,7 +6602,6 @@ describe("$compile", () => {
|
|
|
6677
6602
|
element = $compile('<math><mn pow="2"><mn>8</mn></mn></math>')(
|
|
6678
6603
|
$rootScope,
|
|
6679
6604
|
);
|
|
6680
|
-
$rootScope.$digest();
|
|
6681
6605
|
const child = element.children().eq(0);
|
|
6682
6606
|
expect(getNodeName(child)).toMatch(/msup/i);
|
|
6683
6607
|
expect(isUnknownElement(child[0])).toBe(false);
|
|
@@ -6709,7 +6633,6 @@ describe("$compile", () => {
|
|
|
6709
6633
|
element = $compile(
|
|
6710
6634
|
"<template-url-with-prototype><template-url-with-prototype>",
|
|
6711
6635
|
)($rootScope);
|
|
6712
|
-
$rootScope.$digest();
|
|
6713
6636
|
expect(element.find("p")[0].innerHTML).toEqual("Test Value");
|
|
6714
6637
|
},
|
|
6715
6638
|
);
|
|
@@ -6745,8 +6668,6 @@ describe("$compile", () => {
|
|
|
6745
6668
|
)($rootScope);
|
|
6746
6669
|
expect(element.text()).toEqual("");
|
|
6747
6670
|
|
|
6748
|
-
$rootScope.$digest();
|
|
6749
|
-
|
|
6750
6671
|
expect(element.text()).toEqual("template content");
|
|
6751
6672
|
},
|
|
6752
6673
|
);
|
|
@@ -6928,7 +6849,6 @@ describe("$compile", () => {
|
|
|
6928
6849
|
"<a log>{{name}}; scopeId: {{$id}}</a>",
|
|
6929
6850
|
);
|
|
6930
6851
|
element = $compile("<div><span tscope></span></div>")($rootScope);
|
|
6931
|
-
$rootScope.$digest();
|
|
6932
6852
|
expect(log.length).toEqual(2);
|
|
6933
6853
|
$rootScope.name = "Jozo";
|
|
6934
6854
|
$rootScope.$apply();
|
|
@@ -6941,7 +6861,6 @@ describe("$compile", () => {
|
|
|
6941
6861
|
"<p><a log>{{name}}; scopeId: {{$id}}</a></p>",
|
|
6942
6862
|
);
|
|
6943
6863
|
element = $compile("<div><span trscope></span></div>")($rootScope);
|
|
6944
|
-
$rootScope.$digest();
|
|
6945
6864
|
expect(log.length).toEqual(2);
|
|
6946
6865
|
$rootScope.name = "Jozo";
|
|
6947
6866
|
$rootScope.$apply();
|
|
@@ -6953,7 +6872,6 @@ describe("$compile", () => {
|
|
|
6953
6872
|
element = $compile(
|
|
6954
6873
|
'<div><span ng-repeat="i in [1,2,3]" trscope></span></div>',
|
|
6955
6874
|
)($rootScope);
|
|
6956
|
-
$rootScope.$digest();
|
|
6957
6875
|
expect(log.length).toEqual(6);
|
|
6958
6876
|
$rootScope.name = "Jozo";
|
|
6959
6877
|
$rootScope.$apply();
|
|
@@ -6963,7 +6881,6 @@ describe("$compile", () => {
|
|
|
6963
6881
|
it("should allow creation of new isolated scopes for directives with templates", () => {
|
|
6964
6882
|
$templateCache.set("tiscope.html", "<a log></a>");
|
|
6965
6883
|
element = $compile("<div><span tiscope></span></div>")($rootScope);
|
|
6966
|
-
$rootScope.$digest();
|
|
6967
6884
|
expect(log.length).toEqual(2);
|
|
6968
6885
|
$rootScope.name = "abc";
|
|
6969
6886
|
expect(iscope.$parent).toBe($rootScope);
|
|
@@ -6999,7 +6916,6 @@ describe("$compile", () => {
|
|
|
6999
6916
|
it("should not allow more than one isolate/new scope creation per element regardless of `templateUrl`", () => {
|
|
7000
6917
|
$templateCache.set("tiscope.html", "<div>Hello, world !</div>");
|
|
7001
6918
|
$compile("<div tiscope-a scope-b></div>")($rootScope);
|
|
7002
|
-
$rootScope.$digest();
|
|
7003
6919
|
expect(log[0].match(/multidir/)).toBeTruthy();
|
|
7004
6920
|
});
|
|
7005
6921
|
|
|
@@ -7028,7 +6944,6 @@ describe("$compile", () => {
|
|
|
7028
6944
|
it("should return the new scope for children in the directive template", () => {
|
|
7029
6945
|
$templateCache.set("tscope.html", "<a></a>");
|
|
7030
6946
|
element = $compile("<div tscope></div>")($rootScope);
|
|
7031
|
-
$rootScope.$digest();
|
|
7032
6947
|
expect($rootScope.$$childHead.$parent).toBe($rootScope);
|
|
7033
6948
|
});
|
|
7034
6949
|
|
|
@@ -7056,7 +6971,6 @@ describe("$compile", () => {
|
|
|
7056
6971
|
$templateCache.set("tiscope.html", "<a></a>");
|
|
7057
6972
|
element = $compile("<div tiscope></div>")($rootScope);
|
|
7058
6973
|
expect($rootScope.$$childHead).toBeDefined(); // ??? this is the current behavior, not desired feature
|
|
7059
|
-
$rootScope.$digest();
|
|
7060
6974
|
expect($rootScope.$$childHead).not.toBe($rootScope);
|
|
7061
6975
|
});
|
|
7062
6976
|
|
|
@@ -7377,7 +7291,7 @@ describe("$compile", () => {
|
|
|
7377
7291
|
// $rootScope,
|
|
7378
7292
|
// );
|
|
7379
7293
|
// $rootScope.$apply();
|
|
7380
|
-
//
|
|
7294
|
+
// ;
|
|
7381
7295
|
// directiveElement = element.find("a");
|
|
7382
7296
|
// child = directiveElement.find("span");
|
|
7383
7297
|
// expect(child.scope()).toBe(directiveElement.isolateScope());
|
|
@@ -7512,7 +7426,6 @@ describe("$compile", () => {
|
|
|
7512
7426
|
element = $compile('<div name="attr: {{name}}">text: {{name}}</div>')(
|
|
7513
7427
|
$rootScope,
|
|
7514
7428
|
);
|
|
7515
|
-
$rootScope.$digest();
|
|
7516
7429
|
expect(element.text()).toEqual("text: angular");
|
|
7517
7430
|
expect(element.attr("name")).toEqual("attr: angular");
|
|
7518
7431
|
});
|
|
@@ -7523,12 +7436,10 @@ describe("$compile", () => {
|
|
|
7523
7436
|
'<div name="attr: {{::name}}">text: {{::name}}</div>',
|
|
7524
7437
|
)($rootScope);
|
|
7525
7438
|
expect($rootScope.$$watchers.length).toBe(2);
|
|
7526
|
-
$rootScope.$digest();
|
|
7527
7439
|
expect(element.text()).toEqual("text: angular");
|
|
7528
7440
|
expect(element.attr("name")).toEqual("attr: angular");
|
|
7529
7441
|
expect($rootScope.$$watchers.length).toBe(0);
|
|
7530
7442
|
$rootScope.name = "not-angular";
|
|
7531
|
-
$rootScope.$digest();
|
|
7532
7443
|
expect(element.text()).toEqual("text: angular");
|
|
7533
7444
|
expect(element.attr("name")).toEqual("attr: angular");
|
|
7534
7445
|
});
|
|
@@ -7539,19 +7450,16 @@ describe("$compile", () => {
|
|
|
7539
7450
|
'<div name="attr: {{::name}}">text: {{ ::name }}</div>',
|
|
7540
7451
|
)($rootScope);
|
|
7541
7452
|
expect($rootScope.$$watchers.length).toBe(2);
|
|
7542
|
-
$rootScope.$digest();
|
|
7543
7453
|
expect(element.text()).toEqual("text: angular");
|
|
7544
7454
|
expect(element.attr("name")).toEqual("attr: angular");
|
|
7545
7455
|
expect($rootScope.$$watchers.length).toBe(0);
|
|
7546
7456
|
$rootScope.name = "not-angular";
|
|
7547
|
-
$rootScope.$digest();
|
|
7548
7457
|
expect(element.text()).toEqual("text: angular");
|
|
7549
7458
|
expect(element.attr("name")).toEqual("attr: angular");
|
|
7550
7459
|
});
|
|
7551
7460
|
|
|
7552
7461
|
it("should interpolate a multi-part expression for regular attributes", () => {
|
|
7553
7462
|
element = $compile('<div foo="some/{{id}}"></div>')($rootScope);
|
|
7554
|
-
$rootScope.$digest();
|
|
7555
7463
|
expect(element.attr("foo")).toBe("some/");
|
|
7556
7464
|
$rootScope.$apply(() => {
|
|
7557
7465
|
$rootScope.id = 1;
|
|
@@ -7635,7 +7543,6 @@ describe("$compile", () => {
|
|
|
7635
7543
|
element = $compile('<div name="attr: {{name}}">text: {{name}}</div>')(
|
|
7636
7544
|
$rootScope,
|
|
7637
7545
|
);
|
|
7638
|
-
$rootScope.$digest();
|
|
7639
7546
|
expect(element.text()).toEqual("text: angular");
|
|
7640
7547
|
expect(element.attr("name")).toEqual("attr: angular");
|
|
7641
7548
|
});
|
|
@@ -7676,7 +7583,6 @@ describe("$compile", () => {
|
|
|
7676
7583
|
element = $compile(
|
|
7677
7584
|
'<div some-attr="foo-{{1+1}}" replace-some-attr></div>',
|
|
7678
7585
|
)($rootScope);
|
|
7679
|
-
$rootScope.$digest();
|
|
7680
7586
|
expect(element.attr("some-attr")).toEqual("bar-2");
|
|
7681
7587
|
});
|
|
7682
7588
|
|
|
@@ -7685,7 +7591,6 @@ describe("$compile", () => {
|
|
|
7685
7591
|
expect(directiveAttrs.someAttr).toBe("nonBound");
|
|
7686
7592
|
|
|
7687
7593
|
expect(observeSpy).not.toHaveBeenCalled();
|
|
7688
|
-
$rootScope.$digest();
|
|
7689
7594
|
expect(observeSpy).toHaveBeenCalled();
|
|
7690
7595
|
});
|
|
7691
7596
|
|
|
@@ -7693,7 +7598,6 @@ describe("$compile", () => {
|
|
|
7693
7598
|
const element = $compile('<img src="abc" data-src="123">')($rootScope);
|
|
7694
7599
|
expect(element.attr("src")).toEqual("abc");
|
|
7695
7600
|
expect(element.attr("data-src")).toEqual("123");
|
|
7696
|
-
$rootScope.$digest();
|
|
7697
7601
|
expect(element.attr("src")).toEqual("abc");
|
|
7698
7602
|
expect(element.attr("data-src")).toEqual("123");
|
|
7699
7603
|
});
|
|
@@ -7714,7 +7618,6 @@ describe("$compile", () => {
|
|
|
7714
7618
|
$compile("<observing-directive observer></observing-directive>")(
|
|
7715
7619
|
$rootScope,
|
|
7716
7620
|
);
|
|
7717
|
-
$rootScope.$digest();
|
|
7718
7621
|
expect(observeSpy).not.toHaveBeenCalledWith(undefined);
|
|
7719
7622
|
});
|
|
7720
7623
|
|
|
@@ -7739,8 +7642,6 @@ describe("$compile", () => {
|
|
|
7739
7642
|
);
|
|
7740
7643
|
|
|
7741
7644
|
$compile('<div some-attr="{{value}}" error></div>')($rootScope);
|
|
7742
|
-
$rootScope.$digest();
|
|
7743
|
-
|
|
7744
7645
|
expect(observeSpy).toHaveBeenCalled();
|
|
7745
7646
|
expect(observeSpy).toHaveBeenCalledTimes(2);
|
|
7746
7647
|
});
|
|
@@ -7749,7 +7650,6 @@ describe("$compile", () => {
|
|
|
7749
7650
|
element = $compile(
|
|
7750
7651
|
'<select ng-model="x"><option value="">Greet {{name}}!</option></select>',
|
|
7751
7652
|
)($rootScope);
|
|
7752
|
-
$rootScope.$digest();
|
|
7753
7653
|
expect(
|
|
7754
7654
|
element[0].outerHTML.replace(' selected="selected"', ""),
|
|
7755
7655
|
).toEqual(
|
|
@@ -7758,7 +7658,6 @@ describe("$compile", () => {
|
|
|
7758
7658
|
"</select>",
|
|
7759
7659
|
);
|
|
7760
7660
|
$rootScope.name = "Misko";
|
|
7761
|
-
$rootScope.$digest();
|
|
7762
7661
|
expect(
|
|
7763
7662
|
element[0].outerHTML.replace(' selected="selected"', ""),
|
|
7764
7663
|
).toEqual(
|
|
@@ -7776,7 +7675,6 @@ describe("$compile", () => {
|
|
|
7776
7675
|
// Run the actual test
|
|
7777
7676
|
const base = JQLite('<div>— {{ "This doesn\'t." }}</div>');
|
|
7778
7677
|
element = $compile(base)($rootScope);
|
|
7779
|
-
$rootScope.$digest();
|
|
7780
7678
|
expect(element.text()).toBe("— This doesn't.");
|
|
7781
7679
|
|
|
7782
7680
|
// Unregister the MutationObserver (and hope it doesn't mess up with subsequent tests)
|
|
@@ -7816,7 +7714,6 @@ describe("$compile", () => {
|
|
|
7816
7714
|
$rootScope,
|
|
7817
7715
|
);
|
|
7818
7716
|
$rootScope.hello = "ahoj";
|
|
7819
|
-
$rootScope.$digest();
|
|
7820
7717
|
expect(element.text()).toBe("ahoj|ahoj|ahoj");
|
|
7821
7718
|
});
|
|
7822
7719
|
|
|
@@ -7838,8 +7735,6 @@ describe("$compile", () => {
|
|
|
7838
7735
|
element = $compile(tmpl)($rootScope);
|
|
7839
7736
|
|
|
7840
7737
|
$rootScope.hello = "ahoj";
|
|
7841
|
-
$rootScope.$digest();
|
|
7842
|
-
|
|
7843
7738
|
expect(element.text()).toBe("ahoj|ahoj|ahoj");
|
|
7844
7739
|
});
|
|
7845
7740
|
|
|
@@ -7862,8 +7757,6 @@ describe("$compile", () => {
|
|
|
7862
7757
|
element = $compile(tmpl)($rootScope);
|
|
7863
7758
|
|
|
7864
7759
|
$rootScope.hello = "ahoj";
|
|
7865
|
-
$rootScope.$digest();
|
|
7866
|
-
|
|
7867
7760
|
expect(element.text()).toBe("ahoj|ahoj|ahoj");
|
|
7868
7761
|
});
|
|
7869
7762
|
|
|
@@ -7890,7 +7783,6 @@ describe("$compile", () => {
|
|
|
7890
7783
|
$rootScope,
|
|
7891
7784
|
);
|
|
7892
7785
|
$rootScope.hello = "ahoj";
|
|
7893
|
-
$rootScope.$digest();
|
|
7894
7786
|
expect(element.text()).toBe("ahoj|ahoj|ahoj");
|
|
7895
7787
|
});
|
|
7896
7788
|
|
|
@@ -7915,8 +7807,6 @@ describe("$compile", () => {
|
|
|
7915
7807
|
expect(log).toEqual([]);
|
|
7916
7808
|
|
|
7917
7809
|
$rootScope.myVal = "carrot";
|
|
7918
|
-
$rootScope.$digest();
|
|
7919
|
-
|
|
7920
7810
|
expect(log[0]).toEqual("carrot");
|
|
7921
7811
|
});
|
|
7922
7812
|
});
|
|
@@ -9062,7 +8952,6 @@ describe("$compile", () => {
|
|
|
9062
8952
|
$rootScope.a = "foo";
|
|
9063
8953
|
|
|
9064
8954
|
element = $compile(template)($rootScope);
|
|
9065
|
-
$rootScope.$digest();
|
|
9066
8955
|
expect(constructorSpy).toHaveBeenCalled();
|
|
9067
8956
|
expect(prototypeSpy).not.toHaveBeenCalled();
|
|
9068
8957
|
|
|
@@ -9094,8 +8983,6 @@ describe("$compile", () => {
|
|
|
9094
8983
|
$rootScope.b = NaN;
|
|
9095
8984
|
|
|
9096
8985
|
element = $compile(template)($rootScope);
|
|
9097
|
-
$rootScope.$digest();
|
|
9098
|
-
|
|
9099
8986
|
expect(onChangesSpy).toHaveBeenCalledTimes(2);
|
|
9100
8987
|
expect(onChangesSpy.calls.argsFor(0)[0]).toEqual({
|
|
9101
8988
|
prop: jasmine.objectContaining({ currentValue: "foo" }),
|
|
@@ -9222,7 +9109,6 @@ describe("$compile", () => {
|
|
|
9222
9109
|
|
|
9223
9110
|
// Update val to trigger the onChanges
|
|
9224
9111
|
$rootScope.a = 42;
|
|
9225
|
-
$rootScope.$digest();
|
|
9226
9112
|
expect(log).toEqual([
|
|
9227
9113
|
[
|
|
9228
9114
|
"OuterController",
|
|
@@ -9678,7 +9564,6 @@ describe("$compile", () => {
|
|
|
9678
9564
|
const scope = $rootScope.$$childHead;
|
|
9679
9565
|
expect(scope.ctrl.getProp()).toBe("default");
|
|
9680
9566
|
|
|
9681
|
-
$rootScope.$digest();
|
|
9682
9567
|
expect(scope.ctrl.getProp()).toBe("default");
|
|
9683
9568
|
});
|
|
9684
9569
|
|
|
@@ -9706,10 +9591,8 @@ describe("$compile", () => {
|
|
|
9706
9591
|
element = $compile("<div test-dir></div>")($rootScope);
|
|
9707
9592
|
const scope = $rootScope.$$childHead;
|
|
9708
9593
|
expect(scope.ctrl.getProp()).toBe("default");
|
|
9709
|
-
$rootScope.$digest();
|
|
9710
9594
|
expect(scope.ctrl.getProp()).toBe("default");
|
|
9711
9595
|
scope.prop = "foop";
|
|
9712
|
-
$rootScope.$digest();
|
|
9713
9596
|
expect(scope.ctrl.getProp()).toBe("foop");
|
|
9714
9597
|
});
|
|
9715
9598
|
|
|
@@ -9742,23 +9625,19 @@ describe("$compile", () => {
|
|
|
9742
9625
|
'<div other-tpl-dir param1="::foo" param2="bar"></div>',
|
|
9743
9626
|
)($rootScope);
|
|
9744
9627
|
expect(countWatches($rootScope)).toEqual(6); // 4 -> template watch group, 2 -> '='
|
|
9745
|
-
$rootScope.$digest();
|
|
9746
9628
|
expect(element.html()).toBe("1:;2:;3:;4:");
|
|
9747
9629
|
expect(countWatches($rootScope)).toEqual(6);
|
|
9748
9630
|
|
|
9749
9631
|
$rootScope.foo = "foo";
|
|
9750
|
-
$rootScope.$digest();
|
|
9751
9632
|
expect(element.html()).toBe("1:foo;2:;3:foo;4:");
|
|
9752
9633
|
expect(countWatches($rootScope)).toEqual(4);
|
|
9753
9634
|
|
|
9754
9635
|
$rootScope.foo = "baz";
|
|
9755
9636
|
$rootScope.bar = "bar";
|
|
9756
|
-
$rootScope.$digest();
|
|
9757
9637
|
expect(element.html()).toBe("1:foo;2:bar;3:foo;4:bar");
|
|
9758
9638
|
expect(countWatches($rootScope)).toEqual(3);
|
|
9759
9639
|
|
|
9760
9640
|
$rootScope.bar = "baz";
|
|
9761
|
-
$rootScope.$digest();
|
|
9762
9641
|
expect(element.html()).toBe("1:foo;2:baz;3:foo;4:bar");
|
|
9763
9642
|
});
|
|
9764
9643
|
|
|
@@ -9780,23 +9659,19 @@ describe("$compile", () => {
|
|
|
9780
9659
|
'<div other-tpl-dir param1="{{::foo}}" param2="{{bar}}"></div>',
|
|
9781
9660
|
)($rootScope);
|
|
9782
9661
|
expect(countWatches($rootScope)).toEqual(6); // 4 -> template watch group, 2 -> {{ }}
|
|
9783
|
-
$rootScope.$digest();
|
|
9784
9662
|
expect(element.html()).toBe("1:;2:;3:;4:");
|
|
9785
9663
|
expect(countWatches($rootScope)).toEqual(4); // (- 2) -> bind-once in template
|
|
9786
9664
|
|
|
9787
9665
|
$rootScope.foo = "foo";
|
|
9788
|
-
$rootScope.$digest();
|
|
9789
9666
|
expect(element.html()).toBe("1:foo;2:;3:;4:");
|
|
9790
9667
|
expect(countWatches($rootScope)).toEqual(3);
|
|
9791
9668
|
|
|
9792
9669
|
$rootScope.foo = "baz";
|
|
9793
9670
|
$rootScope.bar = "bar";
|
|
9794
|
-
$rootScope.$digest();
|
|
9795
9671
|
expect(element.html()).toBe("1:foo;2:bar;3:;4:");
|
|
9796
9672
|
expect(countWatches($rootScope)).toEqual(3);
|
|
9797
9673
|
|
|
9798
9674
|
$rootScope.bar = "baz";
|
|
9799
|
-
$rootScope.$digest();
|
|
9800
9675
|
expect(element.html()).toBe("1:foo;2:baz;3:;4:");
|
|
9801
9676
|
});
|
|
9802
9677
|
|
|
@@ -9822,23 +9697,19 @@ describe("$compile", () => {
|
|
|
9822
9697
|
element = $compile(
|
|
9823
9698
|
'<div other-tpl-dir param1="::foo" param2="bar"></div>',
|
|
9824
9699
|
)($rootScope);
|
|
9825
|
-
$rootScope.$digest();
|
|
9826
9700
|
expect(element.html()).toBe("1:;2:;3:;4:");
|
|
9827
9701
|
expect(countWatches($rootScope)).toEqual(6); // 4 -> template watch group, 2 -> '='
|
|
9828
9702
|
|
|
9829
9703
|
$rootScope.foo = "foo";
|
|
9830
|
-
$rootScope.$digest();
|
|
9831
9704
|
expect(element.html()).toBe("1:foo;2:;3:foo;4:");
|
|
9832
9705
|
expect(countWatches($rootScope)).toEqual(4);
|
|
9833
9706
|
|
|
9834
9707
|
$rootScope.foo = "baz";
|
|
9835
9708
|
$rootScope.bar = "bar";
|
|
9836
|
-
$rootScope.$digest();
|
|
9837
9709
|
expect(element.html()).toBe("1:foo;2:bar;3:foo;4:bar");
|
|
9838
9710
|
expect(countWatches($rootScope)).toEqual(3);
|
|
9839
9711
|
|
|
9840
9712
|
$rootScope.bar = "baz";
|
|
9841
|
-
$rootScope.$digest();
|
|
9842
9713
|
expect(element.html()).toBe("1:foo;2:baz;3:foo;4:bar");
|
|
9843
9714
|
});
|
|
9844
9715
|
|
|
@@ -9864,23 +9735,19 @@ describe("$compile", () => {
|
|
|
9864
9735
|
element = $compile(
|
|
9865
9736
|
'<div other-tpl-dir param1="{{::foo}}" param2="{{bar}}"></div>',
|
|
9866
9737
|
)($rootScope);
|
|
9867
|
-
$rootScope.$digest();
|
|
9868
9738
|
expect(element.html()).toBe("1:;2:;3:;4:");
|
|
9869
9739
|
expect(countWatches($rootScope)).toEqual(4); // (4 - 2) -> template watch group, 2 -> {{ }}
|
|
9870
9740
|
|
|
9871
9741
|
$rootScope.foo = "foo";
|
|
9872
|
-
$rootScope.$digest();
|
|
9873
9742
|
expect(element.html()).toBe("1:foo;2:;3:;4:");
|
|
9874
9743
|
expect(countWatches($rootScope)).toEqual(3);
|
|
9875
9744
|
|
|
9876
9745
|
$rootScope.foo = "baz";
|
|
9877
9746
|
$rootScope.bar = "bar";
|
|
9878
|
-
$rootScope.$digest();
|
|
9879
9747
|
expect(element.html()).toBe("1:foo;2:bar;3:;4:");
|
|
9880
9748
|
expect(countWatches($rootScope)).toEqual(3);
|
|
9881
9749
|
|
|
9882
9750
|
$rootScope.bar = "baz";
|
|
9883
|
-
$rootScope.$digest();
|
|
9884
9751
|
expect(element.html()).toBe("1:foo;2:baz;3:;4:");
|
|
9885
9752
|
});
|
|
9886
9753
|
|
|
@@ -9910,7 +9777,6 @@ describe("$compile", () => {
|
|
|
9910
9777
|
'<div><hello greeting="greeting"></hello></div>' +
|
|
9911
9778
|
"</div>",
|
|
9912
9779
|
)($rootScope);
|
|
9913
|
-
$rootScope.$digest();
|
|
9914
9780
|
element.find("button")[0].click();
|
|
9915
9781
|
expect(element.find("p").text()).toBe("Hello!");
|
|
9916
9782
|
});
|
|
@@ -10348,8 +10214,6 @@ describe("$compile", () => {
|
|
|
10348
10214
|
expect($rootScope.name).toEqual("outer");
|
|
10349
10215
|
expect(component.input).toEqual("$onInit");
|
|
10350
10216
|
|
|
10351
|
-
$rootScope.$digest();
|
|
10352
|
-
|
|
10353
10217
|
expect($rootScope.name).toEqual("outer");
|
|
10354
10218
|
expect(component.input).toEqual("$onInit");
|
|
10355
10219
|
|
|
@@ -10371,8 +10235,6 @@ describe("$compile", () => {
|
|
|
10371
10235
|
expect(component.input).toEqual("$onInit");
|
|
10372
10236
|
|
|
10373
10237
|
$rootScope.name[0] = "inner";
|
|
10374
|
-
$rootScope.$digest();
|
|
10375
|
-
|
|
10376
10238
|
expect($rootScope.name).toEqual(["inner"]);
|
|
10377
10239
|
expect(component.input).toEqual("$onInit");
|
|
10378
10240
|
|
|
@@ -10394,8 +10256,6 @@ describe("$compile", () => {
|
|
|
10394
10256
|
expect(component.input).toEqual("$onInit");
|
|
10395
10257
|
|
|
10396
10258
|
$rootScope.name = ["outer"];
|
|
10397
|
-
$rootScope.$digest();
|
|
10398
|
-
|
|
10399
10259
|
expect($rootScope.name).toEqual(["outer"]);
|
|
10400
10260
|
expect(component.input).toEqual(["outer"]);
|
|
10401
10261
|
|
|
@@ -10482,8 +10342,6 @@ describe("$compile", () => {
|
|
|
10482
10342
|
);
|
|
10483
10343
|
|
|
10484
10344
|
expect(component.input).toEqual("$onInit");
|
|
10485
|
-
$rootScope.$digest();
|
|
10486
|
-
|
|
10487
10345
|
expect($rootScope.name).toEqual("outer2");
|
|
10488
10346
|
expect(component.input).toEqual("outer2");
|
|
10489
10347
|
expect(log).toEqual([
|
|
@@ -11173,11 +11031,9 @@ describe("$compile", () => {
|
|
|
11173
11031
|
$rootScope,
|
|
11174
11032
|
);
|
|
11175
11033
|
const p = element.find("p");
|
|
11176
|
-
$rootScope.$digest();
|
|
11177
11034
|
expect(p.text()).toBe("Test: ");
|
|
11178
11035
|
|
|
11179
11036
|
$rootScope.text = "Kittens";
|
|
11180
|
-
$rootScope.$digest();
|
|
11181
11037
|
expect(p.text()).toBe("Test: Kittens");
|
|
11182
11038
|
});
|
|
11183
11039
|
|
|
@@ -11226,7 +11082,6 @@ describe("$compile", () => {
|
|
|
11226
11082
|
'dir-str="Hello, {{whom}}!" ' +
|
|
11227
11083
|
'dir-fn="fn()"></div>',
|
|
11228
11084
|
)($rootScope);
|
|
11229
|
-
$rootScope.$digest();
|
|
11230
11085
|
expect(controllerCalled).toBe(true);
|
|
11231
11086
|
});
|
|
11232
11087
|
|
|
@@ -11332,9 +11187,9 @@ describe("$compile", () => {
|
|
|
11332
11187
|
},
|
|
11333
11188
|
];
|
|
11334
11189
|
|
|
11335
|
-
forEach(
|
|
11336
|
-
|
|
11337
|
-
|
|
11190
|
+
controllerOptions.forEach((controllerOption) => {
|
|
11191
|
+
Object.values(scopeOptions).forEach((scopeOption) => {
|
|
11192
|
+
Object.values(templateOptions).forEach((templateOption) => {
|
|
11338
11193
|
const description = [];
|
|
11339
11194
|
const ddo = {
|
|
11340
11195
|
bindToController: {
|
|
@@ -11345,8 +11200,7 @@ describe("$compile", () => {
|
|
|
11345
11200
|
},
|
|
11346
11201
|
};
|
|
11347
11202
|
|
|
11348
|
-
forEach(
|
|
11349
|
-
[controllerOption, scopeOption, templateOption],
|
|
11203
|
+
[controllerOption, scopeOption, templateOption].forEach(
|
|
11350
11204
|
(option) => {
|
|
11351
11205
|
description.push(option.description);
|
|
11352
11206
|
delete option.description;
|
|
@@ -11388,7 +11242,6 @@ describe("$compile", () => {
|
|
|
11388
11242
|
'dir-str="Hello, {{whom}}!" ' +
|
|
11389
11243
|
'dir-fn="fn()"></div>',
|
|
11390
11244
|
)($rootScope);
|
|
11391
|
-
$rootScope.$digest();
|
|
11392
11245
|
expect(controllerCalled).toBe(true);
|
|
11393
11246
|
if (ddo.controllerAs || ddo.controller.indexOf(" as ") !== -1) {
|
|
11394
11247
|
if (ddo.scope) {
|
|
@@ -11469,7 +11322,6 @@ describe("$compile", () => {
|
|
|
11469
11322
|
'bar-fn="fn2()" > ' +
|
|
11470
11323
|
"</div>",
|
|
11471
11324
|
)($rootScope);
|
|
11472
|
-
$rootScope.$digest();
|
|
11473
11325
|
expect(controller1Called).toBe(true);
|
|
11474
11326
|
expect(controller2Called).toBe(true);
|
|
11475
11327
|
});
|
|
@@ -11540,7 +11392,6 @@ describe("$compile", () => {
|
|
|
11540
11392
|
'bar-fn="fn2()" > ' +
|
|
11541
11393
|
"</div>",
|
|
11542
11394
|
)($rootScope);
|
|
11543
|
-
$rootScope.$digest();
|
|
11544
11395
|
expect(controller1Called).toBe(true);
|
|
11545
11396
|
expect(controller2Called).toBe(true);
|
|
11546
11397
|
});
|
|
@@ -11612,7 +11463,6 @@ describe("$compile", () => {
|
|
|
11612
11463
|
'bar-fn="fn2()" > ' +
|
|
11613
11464
|
"</div>",
|
|
11614
11465
|
)($rootScope);
|
|
11615
|
-
$rootScope.$digest();
|
|
11616
11466
|
expect(controller1Called).toBe(true);
|
|
11617
11467
|
expect(controller2Called).toBe(true);
|
|
11618
11468
|
});
|
|
@@ -11660,8 +11510,6 @@ describe("$compile", () => {
|
|
|
11660
11510
|
"</child>" +
|
|
11661
11511
|
"</div>",
|
|
11662
11512
|
)($rootScope);
|
|
11663
|
-
$rootScope.$digest();
|
|
11664
|
-
|
|
11665
11513
|
const parentCtrl = element.controller("ngController");
|
|
11666
11514
|
const childCtrl = element.find("child").controller("child");
|
|
11667
11515
|
|
|
@@ -11675,8 +11523,6 @@ describe("$compile", () => {
|
|
|
11675
11523
|
expect(childCtrl.fromParent4).not.toBe(childCtrl.value4);
|
|
11676
11524
|
|
|
11677
11525
|
childCtrl.fromParent2 = "modified";
|
|
11678
|
-
$rootScope.$digest();
|
|
11679
|
-
|
|
11680
11526
|
expect(parentCtrl.value2).toBe("modified");
|
|
11681
11527
|
expect(childCtrl.value2).toBe("child2");
|
|
11682
11528
|
});
|
|
@@ -11725,8 +11571,6 @@ describe("$compile", () => {
|
|
|
11725
11571
|
"</child>" +
|
|
11726
11572
|
"</div>",
|
|
11727
11573
|
)($rootScope);
|
|
11728
|
-
$rootScope.$digest();
|
|
11729
|
-
|
|
11730
11574
|
const parentCtrl = element.controller("ngController");
|
|
11731
11575
|
const childCtrl = element.find("child").controller("child");
|
|
11732
11576
|
|
|
@@ -11740,8 +11584,6 @@ describe("$compile", () => {
|
|
|
11740
11584
|
expect(childCtrl.fromParent4).not.toBe(childCtrl.value4);
|
|
11741
11585
|
|
|
11742
11586
|
childCtrl.fromParent2 = "modified";
|
|
11743
|
-
$rootScope.$digest();
|
|
11744
|
-
|
|
11745
11587
|
expect(parentCtrl.value2).toBe("modified");
|
|
11746
11588
|
expect(childCtrl.value2).toBe("child2");
|
|
11747
11589
|
});
|
|
@@ -11766,7 +11608,6 @@ describe("$compile", () => {
|
|
|
11766
11608
|
initInjector("test1");
|
|
11767
11609
|
$templateCache.set("test.html", "<p>isolate</p>");
|
|
11768
11610
|
element = $compile("<div foo-dir>")($rootScope);
|
|
11769
|
-
$rootScope.$digest();
|
|
11770
11611
|
expect(controllerCalled).toBe(true);
|
|
11771
11612
|
const childScope = $rootScope.$$childHead;
|
|
11772
11613
|
expect(childScope).not.toBe($rootScope);
|
|
@@ -11824,7 +11665,6 @@ describe("$compile", () => {
|
|
|
11824
11665
|
'dir-str="Hello, {{whom}}!" ' +
|
|
11825
11666
|
'dir-fn="fn()"></div>',
|
|
11826
11667
|
)($rootScope);
|
|
11827
|
-
$rootScope.$digest();
|
|
11828
11668
|
expect(controllerCalled).toBe(true);
|
|
11829
11669
|
const childScope = $rootScope.$$childHead;
|
|
11830
11670
|
expect(childScope).not.toBe($rootScope);
|
|
@@ -11884,7 +11724,6 @@ describe("$compile", () => {
|
|
|
11884
11724
|
'dir-str="Hello, {{whom}}!" ' +
|
|
11885
11725
|
'dir-fn="fn()"></div>',
|
|
11886
11726
|
)($rootScope);
|
|
11887
|
-
$rootScope.$digest();
|
|
11888
11727
|
expect(controllerCalled).toBe(true);
|
|
11889
11728
|
const childScope = $rootScope.$$childHead;
|
|
11890
11729
|
expect(childScope).not.toBe($rootScope);
|
|
@@ -11920,7 +11759,6 @@ describe("$compile", () => {
|
|
|
11920
11759
|
const scope = $rootScope.$$childHead;
|
|
11921
11760
|
expect(scope.ctrl.getProp()).toBe("default");
|
|
11922
11761
|
|
|
11923
|
-
$rootScope.$digest();
|
|
11924
11762
|
expect(scope.ctrl.getProp()).toBe("default");
|
|
11925
11763
|
});
|
|
11926
11764
|
|
|
@@ -11950,7 +11788,6 @@ describe("$compile", () => {
|
|
|
11950
11788
|
const scope = $rootScope.$$childHead;
|
|
11951
11789
|
expect(scope.ctrl.getProp()).toBe("default");
|
|
11952
11790
|
|
|
11953
|
-
$rootScope.$digest();
|
|
11954
11791
|
expect(scope.ctrl.getProp()).toBe("default");
|
|
11955
11792
|
});
|
|
11956
11793
|
});
|
|
@@ -12219,7 +12056,6 @@ describe("$compile", () => {
|
|
|
12219
12056
|
initInjector("test1");
|
|
12220
12057
|
$templateCache.set("dirB.html", "<p>dirB</p>");
|
|
12221
12058
|
element = $compile("<div dir-a dir-b></div>")($rootScope);
|
|
12222
|
-
$rootScope.$digest();
|
|
12223
12059
|
expect(log[0]).toEqual("dirAController.name: dirA");
|
|
12224
12060
|
});
|
|
12225
12061
|
|
|
@@ -12539,7 +12375,6 @@ describe("$compile", () => {
|
|
|
12539
12375
|
element = element.children().eq(0);
|
|
12540
12376
|
expect(element[0].checked).toBe(false);
|
|
12541
12377
|
$rootScope.$$childHead.model = true;
|
|
12542
|
-
$rootScope.$digest();
|
|
12543
12378
|
expect(element[0].checked).toBe(true);
|
|
12544
12379
|
});
|
|
12545
12380
|
|
|
@@ -12567,7 +12402,6 @@ describe("$compile", () => {
|
|
|
12567
12402
|
expect(normalScope).toBe($rootScope);
|
|
12568
12403
|
expect(normalScope.name).toEqual(undefined);
|
|
12569
12404
|
expect(isolateScope.name).toEqual("WORKS");
|
|
12570
|
-
$rootScope.$digest();
|
|
12571
12405
|
expect(element.text()).toEqual("WORKS");
|
|
12572
12406
|
});
|
|
12573
12407
|
|
|
@@ -12626,7 +12460,6 @@ describe("$compile", () => {
|
|
|
12626
12460
|
"</div>",
|
|
12627
12461
|
)($rootScope);
|
|
12628
12462
|
|
|
12629
|
-
$rootScope.$digest();
|
|
12630
12463
|
expect(log.join("; ")).toEqual(
|
|
12631
12464
|
"inside=isolate; " +
|
|
12632
12465
|
"outside replaced=non-isolate; " + // outside
|
|
@@ -13330,8 +13163,6 @@ describe("$compile", () => {
|
|
|
13330
13163
|
const elem1 = $compile(tmplWithFoo)($rootScope);
|
|
13331
13164
|
const elem2 = $compile(tmplWithBar)($rootScope);
|
|
13332
13165
|
|
|
13333
|
-
$rootScope.$digest();
|
|
13334
|
-
|
|
13335
13166
|
expect(elem1.text()).toBe("[Hello, world!]");
|
|
13336
13167
|
expect(elem2.text()).toBe("[This is a header!|This is a footer!]");
|
|
13337
13168
|
|
|
@@ -13478,7 +13309,7 @@ describe("$compile", () => {
|
|
|
13478
13309
|
// module
|
|
13479
13310
|
// .controller("Leak", ($scope, $timeout) => {
|
|
13480
13311
|
// $scope.code = "red";
|
|
13481
|
-
//
|
|
13312
|
+
// setTimeout(() => {
|
|
13482
13313
|
// $scope.code = "blue";
|
|
13483
13314
|
// });
|
|
13484
13315
|
// })
|
|
@@ -13506,7 +13337,7 @@ describe("$compile", () => {
|
|
|
13506
13337
|
// "</div>",
|
|
13507
13338
|
// );
|
|
13508
13339
|
// element = template($rootScope, function () {});
|
|
13509
|
-
//
|
|
13340
|
+
// ;
|
|
13510
13341
|
|
|
13511
13342
|
// expect(linkFn).toHaveBeenCalled();
|
|
13512
13343
|
// expect(CACHE.size).toEqual(cacheSize + 2);
|
|
@@ -13515,7 +13346,7 @@ describe("$compile", () => {
|
|
|
13515
13346
|
// const destroyedScope = $rootScope.$new();
|
|
13516
13347
|
// destroyedScope.$destroy();
|
|
13517
13348
|
// const clone = template(destroyedScope, () => {});
|
|
13518
|
-
//
|
|
13349
|
+
// ;
|
|
13519
13350
|
// // expect(linkFn).not.toHaveBeenCalled();
|
|
13520
13351
|
// // clone.remove();
|
|
13521
13352
|
// });
|
|
@@ -14413,7 +14244,6 @@ describe("$compile", () => {
|
|
|
14413
14244
|
element = $compile("<div sync-sync>transcluded content</div>")(
|
|
14414
14245
|
$rootScope,
|
|
14415
14246
|
);
|
|
14416
|
-
$rootScope.$digest();
|
|
14417
14247
|
expect(element.text()).toEqual("transcluded content");
|
|
14418
14248
|
});
|
|
14419
14249
|
|
|
@@ -14421,7 +14251,6 @@ describe("$compile", () => {
|
|
|
14421
14251
|
element = $compile("<div sync-async>transcluded content</div>")(
|
|
14422
14252
|
$rootScope,
|
|
14423
14253
|
);
|
|
14424
|
-
$rootScope.$digest();
|
|
14425
14254
|
expect(element.text()).toEqual("transcluded content");
|
|
14426
14255
|
});
|
|
14427
14256
|
|
|
@@ -14429,7 +14258,6 @@ describe("$compile", () => {
|
|
|
14429
14258
|
element = $compile("<div async-sync>transcluded content</div>")(
|
|
14430
14259
|
$rootScope,
|
|
14431
14260
|
);
|
|
14432
|
-
$rootScope.$digest();
|
|
14433
14261
|
expect(element.text()).toEqual("transcluded content");
|
|
14434
14262
|
});
|
|
14435
14263
|
|
|
@@ -14437,7 +14265,6 @@ describe("$compile", () => {
|
|
|
14437
14265
|
element = $compile("<div async-async>transcluded content</div>")(
|
|
14438
14266
|
$rootScope,
|
|
14439
14267
|
);
|
|
14440
|
-
$rootScope.$digest();
|
|
14441
14268
|
expect(element.text()).toEqual("transcluded content");
|
|
14442
14269
|
});
|
|
14443
14270
|
|
|
@@ -14523,7 +14350,6 @@ describe("$compile", () => {
|
|
|
14523
14350
|
element = $compile('<iso><span ng-bind="val"></span></iso>')(
|
|
14524
14351
|
$rootScope,
|
|
14525
14352
|
);
|
|
14526
|
-
$rootScope.$digest();
|
|
14527
14353
|
expect(element.text()).toEqual("transcluded content");
|
|
14528
14354
|
});
|
|
14529
14355
|
|
|
@@ -14532,7 +14358,6 @@ describe("$compile", () => {
|
|
|
14532
14358
|
element = $compile(
|
|
14533
14359
|
'<iso-async1><span ng-bind="val"></span></iso-async1>',
|
|
14534
14360
|
)($rootScope);
|
|
14535
|
-
$rootScope.$digest();
|
|
14536
14361
|
expect(element.text()).toEqual("transcluded content");
|
|
14537
14362
|
});
|
|
14538
14363
|
|
|
@@ -14541,7 +14366,6 @@ describe("$compile", () => {
|
|
|
14541
14366
|
element = $compile(
|
|
14542
14367
|
'<iso-async2><span ng-bind="val"></span></iso-async2>',
|
|
14543
14368
|
)($rootScope);
|
|
14544
|
-
$rootScope.$digest();
|
|
14545
14369
|
expect(element.text()).toEqual("transcluded content");
|
|
14546
14370
|
});
|
|
14547
14371
|
});
|
|
@@ -14568,12 +14392,10 @@ describe("$compile", () => {
|
|
|
14568
14392
|
|
|
14569
14393
|
initInjector("test1");
|
|
14570
14394
|
let element = $compile("<div my-example></div>")($rootScope);
|
|
14571
|
-
$rootScope.$digest();
|
|
14572
14395
|
expect(element.text()).toEqual("myExample 0!");
|
|
14573
14396
|
dealoc(element);
|
|
14574
14397
|
|
|
14575
14398
|
element = $compile("<div my-example><p></p></div>")($rootScope);
|
|
14576
|
-
$rootScope.$digest();
|
|
14577
14399
|
expect(element.text()).toEqual("myExample 1!has children");
|
|
14578
14400
|
dealoc(element);
|
|
14579
14401
|
});
|
|
@@ -14700,7 +14522,6 @@ describe("$compile", () => {
|
|
|
14700
14522
|
$templateCache.set("template.html", "<p second>template.html</p>");
|
|
14701
14523
|
expect(() => {
|
|
14702
14524
|
$compile("<div template first></div>");
|
|
14703
|
-
$rootScope.$digest();
|
|
14704
14525
|
}).toThrowError(/multidir/);
|
|
14705
14526
|
});
|
|
14706
14527
|
|
|
@@ -14926,7 +14747,6 @@ describe("$compile", () => {
|
|
|
14926
14747
|
initInjector("test1");
|
|
14927
14748
|
$templateCache.set("template.html", "<div transclude></div>");
|
|
14928
14749
|
element = $compile("<div template></div>")($rootScope);
|
|
14929
|
-
$rootScope.$digest();
|
|
14930
14750
|
expect(transclude).toBeDefined();
|
|
14931
14751
|
});
|
|
14932
14752
|
|
|
@@ -14967,7 +14787,6 @@ describe("$compile", () => {
|
|
|
14967
14787
|
element = $compile("<div><div outer><div inner></div></div></div>")(
|
|
14968
14788
|
$rootScope,
|
|
14969
14789
|
);
|
|
14970
|
-
$rootScope.$digest();
|
|
14971
14790
|
const child = element.children();
|
|
14972
14791
|
|
|
14973
14792
|
expect(log).toEqual(["outer:div", "innerAgain:div", "inner:div"]);
|
|
@@ -14997,7 +14816,6 @@ describe("$compile", () => {
|
|
|
14997
14816
|
$rootScope,
|
|
14998
14817
|
);
|
|
14999
14818
|
$rootScope.bar = "bar";
|
|
15000
|
-
$rootScope.$digest();
|
|
15001
14819
|
expect(element.text()).toBe("bar");
|
|
15002
14820
|
});
|
|
15003
14821
|
|
|
@@ -15013,7 +14831,6 @@ describe("$compile", () => {
|
|
|
15013
14831
|
element = $compile("<div><div foo=\"'foo'\" bar=\"'bar'\"></div></div>")(
|
|
15014
14832
|
$rootScope,
|
|
15015
14833
|
);
|
|
15016
|
-
$rootScope.$digest();
|
|
15017
14834
|
expect(element.text()).toBe("foobar");
|
|
15018
14835
|
});
|
|
15019
14836
|
|
|
@@ -15022,8 +14839,6 @@ describe("$compile", () => {
|
|
|
15022
14839
|
element = $compile(
|
|
15023
14840
|
"<ul><li ng-repeat=\"item in ['-->', 'x']\">{{item}}|</li></ul>",
|
|
15024
14841
|
)($rootScope);
|
|
15025
|
-
$rootScope.$digest();
|
|
15026
|
-
|
|
15027
14842
|
expect(element.text()).toBe("-->|x|");
|
|
15028
14843
|
});
|
|
15029
14844
|
|
|
@@ -15041,11 +14856,11 @@ describe("$compile", () => {
|
|
|
15041
14856
|
});
|
|
15042
14857
|
},
|
|
15043
14858
|
}))
|
|
15044
|
-
.directive("trans", (
|
|
14859
|
+
.directive("trans", () => ({
|
|
15045
14860
|
transclude: true,
|
|
15046
14861
|
link(scope, element, attrs, ctrl, transclude) {
|
|
15047
14862
|
// We use timeout here to simulate how ng-if works
|
|
15048
|
-
|
|
14863
|
+
setTimeout(() => {
|
|
15049
14864
|
transclude((child) => {
|
|
15050
14865
|
element.append(child);
|
|
15051
14866
|
});
|
|
@@ -15167,8 +14982,6 @@ describe("$compile", () => {
|
|
|
15167
14982
|
initInjector("test1");
|
|
15168
14983
|
$templateCache.set("baz.html", "<div>Baz</div>");
|
|
15169
14984
|
element = $compile("<trans><inner></inner></trans>")($rootScope);
|
|
15170
|
-
$rootScope.$digest();
|
|
15171
|
-
|
|
15172
14985
|
expect(innerCompilationCount).toBe(0);
|
|
15173
14986
|
transclude((child) => {
|
|
15174
14987
|
element.append(child);
|
|
@@ -15288,8 +15101,6 @@ describe("$compile", () => {
|
|
|
15288
15101
|
initInjector("test1");
|
|
15289
15102
|
$templateCache.set("inner.html", "<inner></inner>");
|
|
15290
15103
|
element = $compile("<outer></outer>")($rootScope);
|
|
15291
|
-
$rootScope.$digest();
|
|
15292
|
-
|
|
15293
15104
|
expect(innerCompilationCount).toBe(1);
|
|
15294
15105
|
});
|
|
15295
15106
|
});
|
|
@@ -15639,7 +15450,6 @@ describe("$compile", () => {
|
|
|
15639
15450
|
it("should NOT require trusted values for trusted URIs", () => {
|
|
15640
15451
|
element = $compile(`<${tag} src="{{testUrl}}"></${tag}>`)($rootScope);
|
|
15641
15452
|
$rootScope.testUrl = "http://example.com/image.mp4"; // `http` is trusted
|
|
15642
|
-
$rootScope.$digest();
|
|
15643
15453
|
expect(element.attr("src")).toEqual("http://example.com/image.mp4");
|
|
15644
15454
|
});
|
|
15645
15455
|
|
|
@@ -15649,19 +15459,16 @@ describe("$compile", () => {
|
|
|
15649
15459
|
// Some browsers complain if you try to write `javascript:` into an `img[src]`
|
|
15650
15460
|
// So for the test use something different
|
|
15651
15461
|
$rootScope.testUrl = $sce.trustAsMediaUrl("untrusted:foo()");
|
|
15652
|
-
$rootScope.$digest();
|
|
15653
15462
|
expect(element.attr("src")).toEqual("untrusted:foo()");
|
|
15654
15463
|
|
|
15655
15464
|
// As a URL
|
|
15656
15465
|
element = $compile(`<${tag} src="{{testUrl}}"></${tag}>`)($rootScope);
|
|
15657
15466
|
$rootScope.testUrl = $sce.trustAsUrl("untrusted:foo()");
|
|
15658
|
-
$rootScope.$digest();
|
|
15659
15467
|
expect(element.attr("src")).toEqual("untrusted:foo()");
|
|
15660
15468
|
|
|
15661
15469
|
// As a RESOURCE URL
|
|
15662
15470
|
element = $compile(`<${tag} src="{{testUrl}}"></${tag}>`)($rootScope);
|
|
15663
15471
|
$rootScope.testUrl = $sce.trustAsResourceUrl("untrusted:foo()");
|
|
15664
|
-
$rootScope.$digest();
|
|
15665
15472
|
expect(element.attr("src")).toEqual("untrusted:foo()");
|
|
15666
15473
|
});
|
|
15667
15474
|
});
|
|
@@ -15674,7 +15481,6 @@ describe("$compile", () => {
|
|
|
15674
15481
|
`<video><${tag} src="{{testUrl}}"></${tag}></video>`,
|
|
15675
15482
|
)($rootScope);
|
|
15676
15483
|
$rootScope.testUrl = "http://example.com/image.mp4"; // `http` is trusted
|
|
15677
|
-
$rootScope.$digest();
|
|
15678
15484
|
expect(element.find(tag).attr("src")).toEqual(
|
|
15679
15485
|
"http://example.com/image.mp4",
|
|
15680
15486
|
);
|
|
@@ -15686,7 +15492,6 @@ describe("$compile", () => {
|
|
|
15686
15492
|
`<video><${tag} src="{{testUrl}}"></${tag}></video>`,
|
|
15687
15493
|
)($rootScope);
|
|
15688
15494
|
$rootScope.testUrl = $sce.trustAsMediaUrl("javascript:foo()");
|
|
15689
|
-
$rootScope.$digest();
|
|
15690
15495
|
expect(element.find(tag).attr("src")).toEqual("javascript:foo()");
|
|
15691
15496
|
|
|
15692
15497
|
// As a URL
|
|
@@ -15694,7 +15499,6 @@ describe("$compile", () => {
|
|
|
15694
15499
|
`<video><${tag} src="{{testUrl}}"></${tag}></video>`,
|
|
15695
15500
|
)($rootScope);
|
|
15696
15501
|
$rootScope.testUrl = $sce.trustAsUrl("javascript:foo()");
|
|
15697
|
-
$rootScope.$digest();
|
|
15698
15502
|
expect(element.find(tag).attr("src")).toEqual("javascript:foo()");
|
|
15699
15503
|
|
|
15700
15504
|
// As a RESOURCE URL
|
|
@@ -15702,7 +15506,6 @@ describe("$compile", () => {
|
|
|
15702
15506
|
`<video><${tag} src="{{testUrl}}"></${tag}></video>`,
|
|
15703
15507
|
)($rootScope);
|
|
15704
15508
|
$rootScope.testUrl = $sce.trustAsResourceUrl("javascript:foo()");
|
|
15705
|
-
$rootScope.$digest();
|
|
15706
15509
|
expect(element.find(tag).attr("src")).toEqual("javascript:foo()");
|
|
15707
15510
|
});
|
|
15708
15511
|
});
|
|
@@ -15714,26 +15517,22 @@ describe("$compile", () => {
|
|
|
15714
15517
|
// Some browsers complain if you try to write `javascript:` into an `img[src]`
|
|
15715
15518
|
// So for the test use something different
|
|
15716
15519
|
$rootScope.testUrl = $sce.trustAsMediaUrl("someUntrustedThing:foo();");
|
|
15717
|
-
$rootScope.$digest();
|
|
15718
15520
|
expect(element.attr("src")).toEqual("someUntrustedThing:foo();");
|
|
15719
15521
|
});
|
|
15720
15522
|
|
|
15721
15523
|
it("should sanitize concatenated values even if they are trusted", () => {
|
|
15722
15524
|
element = $compile('<img src="{{testUrl}}ponies"></img>')($rootScope);
|
|
15723
15525
|
$rootScope.testUrl = $sce.trustAsUrl("untrusted:foo();");
|
|
15724
|
-
$rootScope.$digest();
|
|
15725
15526
|
expect(element.attr("src")).toEqual("unsafe:untrusted:foo();ponies");
|
|
15726
15527
|
|
|
15727
15528
|
element = $compile('<img src="http://{{testUrl2}}"></img>')($rootScope);
|
|
15728
15529
|
$rootScope.testUrl2 = $sce.trustAsUrl("xyz;");
|
|
15729
|
-
$rootScope.$digest();
|
|
15730
15530
|
expect(element.attr("src")).toEqual("http://xyz;");
|
|
15731
15531
|
|
|
15732
15532
|
element = $compile('<img src="{{testUrl3}}{{testUrl3}}"></img>')(
|
|
15733
15533
|
$rootScope,
|
|
15734
15534
|
);
|
|
15735
15535
|
$rootScope.testUrl3 = $sce.trustAsUrl("untrusted:foo();");
|
|
15736
|
-
$rootScope.$digest();
|
|
15737
15536
|
expect(element.attr("src")).toEqual(
|
|
15738
15537
|
"unsafe:untrusted:foo();untrusted:foo();",
|
|
15739
15538
|
);
|
|
@@ -15770,12 +15569,10 @@ describe("$compile", () => {
|
|
|
15770
15569
|
|
|
15771
15570
|
element = $compile('<img src="{{testUrl}}ponies"></img>')($rootScope);
|
|
15772
15571
|
$rootScope.testUrl = $sce.trustAsUrl("javascript:foo();");
|
|
15773
|
-
$rootScope.$digest();
|
|
15774
15572
|
expect(element.attr("src")).toEqual("someSanitizedUrl");
|
|
15775
15573
|
|
|
15776
15574
|
element = $compile('<img src="http://{{testUrl}}"></img>')($rootScope);
|
|
15777
15575
|
$rootScope.testUrl = $sce.trustAsUrl("xyz");
|
|
15778
|
-
$rootScope.$digest();
|
|
15779
15576
|
expect(element.attr("src")).toEqual("someSanitizedUrl");
|
|
15780
15577
|
});
|
|
15781
15578
|
|
|
@@ -15818,14 +15615,12 @@ describe("$compile", () => {
|
|
|
15818
15615
|
it("should NOT require trusted values for trusted URI values", () => {
|
|
15819
15616
|
element = $compile('<img srcset="{{testUrl}}"></img>')($rootScope);
|
|
15820
15617
|
$rootScope.testUrl = "http://example.com/image.png"; // `http` is trusted
|
|
15821
|
-
$rootScope.$digest();
|
|
15822
15618
|
expect(element.attr("srcset")).toEqual("http://example.com/image.png");
|
|
15823
15619
|
});
|
|
15824
15620
|
|
|
15825
15621
|
it("should accept trusted values, if they are also trusted URIs", () => {
|
|
15826
15622
|
element = $compile('<img srcset="{{testUrl}}"></img>')($rootScope);
|
|
15827
15623
|
$rootScope.testUrl = $sce.trustAsUrl("http://example.com");
|
|
15828
|
-
$rootScope.$digest();
|
|
15829
15624
|
expect(element.attr("srcset")).toEqual("http://example.com");
|
|
15830
15625
|
});
|
|
15831
15626
|
|
|
@@ -15834,14 +15629,12 @@ describe("$compile", () => {
|
|
|
15834
15629
|
// Use trustAsHtml and ng-bind-html to work around this.
|
|
15835
15630
|
element = $compile('<img srcset="{{testUrl}}"></img>')($rootScope);
|
|
15836
15631
|
$rootScope.testUrl = $sce.trustAsUrl("javascript:something");
|
|
15837
|
-
$rootScope.$digest();
|
|
15838
15632
|
expect(element.attr("srcset")).toEqual("unsafe:javascript:something");
|
|
15839
15633
|
|
|
15840
15634
|
element = $compile('<img srcset="{{testUrl}},{{testUrl}}"></img>')(
|
|
15841
15635
|
$rootScope,
|
|
15842
15636
|
);
|
|
15843
15637
|
$rootScope.testUrl = $sce.trustAsUrl("javascript:something");
|
|
15844
|
-
$rootScope.$digest();
|
|
15845
15638
|
expect(element.attr("srcset")).toEqual(
|
|
15846
15639
|
"unsafe:javascript:something ,unsafe:javascript:something",
|
|
15847
15640
|
);
|
|
@@ -15924,9 +15717,8 @@ describe("$compile", () => {
|
|
|
15924
15717
|
"http://example.com/image1.jpg?x=a2x,b 1x,http://example.com/ima,ge2.jpg 2x",
|
|
15925
15718
|
};
|
|
15926
15719
|
|
|
15927
|
-
forEach(
|
|
15720
|
+
Object.entries(testSet).forEach(([url, ref]) => {
|
|
15928
15721
|
$rootScope.testUrl = url;
|
|
15929
|
-
$rootScope.$digest();
|
|
15930
15722
|
expect(element.attr("srcset")).toEqual(ref);
|
|
15931
15723
|
});
|
|
15932
15724
|
});
|
|
@@ -15936,33 +15728,27 @@ describe("$compile", () => {
|
|
|
15936
15728
|
it("should NOT require trusted values for trusted URI values", () => {
|
|
15937
15729
|
$rootScope.testUrl = "http://example.com/image.png"; // `http` is trusted
|
|
15938
15730
|
element = $compile('<a href="{{testUrl}}"></a>')($rootScope);
|
|
15939
|
-
$rootScope.$digest();
|
|
15940
15731
|
expect(element.attr("href")).toEqual("http://example.com/image.png");
|
|
15941
15732
|
|
|
15942
15733
|
element = $compile('<a ng-href="{{testUrl}}"></a>')($rootScope);
|
|
15943
|
-
$rootScope.$digest();
|
|
15944
15734
|
expect(element.attr("ng-href")).toEqual("http://example.com/image.png");
|
|
15945
15735
|
});
|
|
15946
15736
|
|
|
15947
15737
|
it("should accept trusted values for non-trusted URI values", () => {
|
|
15948
15738
|
$rootScope.testUrl = $sce.trustAsUrl("javascript:foo()"); // `javascript` is not trusted
|
|
15949
15739
|
element = $compile('<a href="{{testUrl}}"></a>')($rootScope);
|
|
15950
|
-
$rootScope.$digest();
|
|
15951
15740
|
expect(element.attr("href")).toEqual("javascript:foo()");
|
|
15952
15741
|
|
|
15953
15742
|
element = $compile('<a ng-href="{{testUrl}}"></a>')($rootScope);
|
|
15954
|
-
$rootScope.$digest();
|
|
15955
15743
|
expect(element.attr("ng-href")).toEqual("javascript:foo()");
|
|
15956
15744
|
});
|
|
15957
15745
|
|
|
15958
15746
|
it("should sanitize non-trusted values", () => {
|
|
15959
15747
|
$rootScope.testUrl = "javascript:foo()"; // `javascript` is not trusted
|
|
15960
15748
|
element = $compile('<a href="{{testUrl}}"></a>')($rootScope);
|
|
15961
|
-
$rootScope.$digest();
|
|
15962
15749
|
expect(element.attr("href")).toEqual("unsafe:javascript:foo()");
|
|
15963
15750
|
|
|
15964
15751
|
element = $compile('<a ng-href="{{testUrl}}"></a>')($rootScope);
|
|
15965
|
-
$rootScope.$digest();
|
|
15966
15752
|
expect(element.attr("href")).toEqual("unsafe:javascript:foo()");
|
|
15967
15753
|
});
|
|
15968
15754
|
|
|
@@ -16086,16 +15872,9 @@ describe("$compile", () => {
|
|
|
16086
15872
|
'<foo href="http://example.com/{{testUrl}}"></foo><foo href="http://example.com/{{::testUrl}}"></foo>',
|
|
16087
15873
|
)($rootScope);
|
|
16088
15874
|
$rootScope.testUrl = [1];
|
|
16089
|
-
$rootScope.$digest();
|
|
16090
|
-
|
|
16091
15875
|
$rootScope.testUrl = [];
|
|
16092
|
-
$rootScope.$digest();
|
|
16093
|
-
|
|
16094
15876
|
$rootScope.testUrl = { a: "b" };
|
|
16095
|
-
$rootScope.$digest();
|
|
16096
|
-
|
|
16097
15877
|
$rootScope.testUrl = {};
|
|
16098
|
-
$rootScope.$digest();
|
|
16099
15878
|
expect(true).toBeTrue();
|
|
16100
15879
|
});
|
|
16101
15880
|
});
|
|
@@ -16328,7 +16107,6 @@ describe("$compile", () => {
|
|
|
16328
16107
|
$rootScope.name = "Misko";
|
|
16329
16108
|
element = $compile('<span ng-attr-test="{{name}}"></span>')($rootScope);
|
|
16330
16109
|
expect(element.attr("test")).toBeUndefined();
|
|
16331
|
-
$rootScope.$digest();
|
|
16332
16110
|
expect(element.attr("test")).toBe("Misko");
|
|
16333
16111
|
});
|
|
16334
16112
|
|
|
@@ -16338,7 +16116,6 @@ describe("$compile", () => {
|
|
|
16338
16116
|
$rootScope,
|
|
16339
16117
|
);
|
|
16340
16118
|
expect(element.attr("test")).toBe("123");
|
|
16341
|
-
$rootScope.$digest();
|
|
16342
16119
|
expect(element.attr("test")).toBe("Misko");
|
|
16343
16120
|
});
|
|
16344
16121
|
|
|
@@ -16348,7 +16125,6 @@ describe("$compile", () => {
|
|
|
16348
16125
|
$rootScope,
|
|
16349
16126
|
);
|
|
16350
16127
|
expect(element.attr("test")).toBe("123");
|
|
16351
|
-
$rootScope.$digest();
|
|
16352
16128
|
expect(element.attr("test")).toBe("Misko");
|
|
16353
16129
|
});
|
|
16354
16130
|
|
|
@@ -16356,7 +16132,6 @@ describe("$compile", () => {
|
|
|
16356
16132
|
element = $compile('<span ng-attr-test="foo"></span>')($rootScope);
|
|
16357
16133
|
expect(element.attr("test")).toBeUndefined();
|
|
16358
16134
|
|
|
16359
|
-
$rootScope.$digest();
|
|
16360
16135
|
expect(element.attr("test")).toBe("foo");
|
|
16361
16136
|
});
|
|
16362
16137
|
|
|
@@ -16364,13 +16139,10 @@ describe("$compile", () => {
|
|
|
16364
16139
|
element = $compile('<span ng-attr-test="{{name}}{{emphasis}}"></span>')(
|
|
16365
16140
|
$rootScope,
|
|
16366
16141
|
);
|
|
16367
|
-
$rootScope.$digest();
|
|
16368
16142
|
expect(element.attr("test")).toBeUndefined();
|
|
16369
16143
|
$rootScope.name = "caitp";
|
|
16370
|
-
$rootScope.$digest();
|
|
16371
16144
|
expect(element.attr("test")).toBeUndefined();
|
|
16372
16145
|
$rootScope.emphasis = "!!!";
|
|
16373
|
-
$rootScope.$digest();
|
|
16374
16146
|
expect(element.attr("test")).toBe("caitp!!!");
|
|
16375
16147
|
});
|
|
16376
16148
|
|
|
@@ -16426,7 +16198,6 @@ describe("$compile", () => {
|
|
|
16426
16198
|
'<div async-test test="123" ng-attr-test="{{test}}"></div>',
|
|
16427
16199
|
)($rootScope);
|
|
16428
16200
|
expect(element.attr("test")).toBe("123");
|
|
16429
|
-
$rootScope.$digest();
|
|
16430
16201
|
expect(log).toEqual(["TEST", "TEST"]);
|
|
16431
16202
|
});
|
|
16432
16203
|
|
|
@@ -16436,7 +16207,6 @@ describe("$compile", () => {
|
|
|
16436
16207
|
'<div async-test ng-attr-test="{{test}}" test="123"></div>',
|
|
16437
16208
|
)($rootScope);
|
|
16438
16209
|
expect(element.attr("test")).toBe("123");
|
|
16439
|
-
$rootScope.$digest();
|
|
16440
16210
|
expect(log).toEqual(["TEST", "TEST"]);
|
|
16441
16211
|
});
|
|
16442
16212
|
});
|
|
@@ -16449,7 +16219,6 @@ describe("$compile", () => {
|
|
|
16449
16219
|
expect(element.attr("test")).toBeUndefined();
|
|
16450
16220
|
expect(element.attr("test2")).toBeUndefined();
|
|
16451
16221
|
expect(element.attr("test3")).toBeUndefined();
|
|
16452
|
-
$rootScope.$digest();
|
|
16453
16222
|
expect(element.attr("test")).toBe("Misko");
|
|
16454
16223
|
expect(element.attr("test2")).toBe("Misko");
|
|
16455
16224
|
expect(element.attr("test3")).toBe("Misko");
|
|
@@ -16494,7 +16263,6 @@ describe("$compile", () => {
|
|
|
16494
16263
|
it('should work with the "href" attribute', () => {
|
|
16495
16264
|
$rootScope.value = "test";
|
|
16496
16265
|
element = $compile('<a ng-attr-href="test/{{value}}"></a>')($rootScope);
|
|
16497
|
-
$rootScope.$digest();
|
|
16498
16266
|
expect(element.attr("href")).toBe("test/test");
|
|
16499
16267
|
});
|
|
16500
16268
|
|
|
@@ -16509,7 +16277,6 @@ describe("$compile", () => {
|
|
|
16509
16277
|
expect(element.attr("test4")).toBeUndefined();
|
|
16510
16278
|
expect(element.attr("test5")).toBeUndefined();
|
|
16511
16279
|
expect(element.attr("test6")).toBeUndefined();
|
|
16512
|
-
$rootScope.$digest();
|
|
16513
16280
|
expect(element.attr("test2")).toBe("Misko");
|
|
16514
16281
|
expect(element.attr("test3")).toBe("Misko");
|
|
16515
16282
|
expect(element.attr("test4")).toBe("Misko");
|
|
@@ -16523,11 +16290,9 @@ describe("$compile", () => {
|
|
|
16523
16290
|
element = $compile('<img ng-attr-src="{{name}}">')($rootScope);
|
|
16524
16291
|
expect(element.attr("src")).toBeUndefined();
|
|
16525
16292
|
|
|
16526
|
-
$rootScope.$digest();
|
|
16527
16293
|
expect(element.attr("src")).toBe("some-image.png");
|
|
16528
16294
|
|
|
16529
16295
|
$rootScope.name = "other-image.png";
|
|
16530
|
-
$rootScope.$digest();
|
|
16531
16296
|
expect(element.attr("src")).toBe("other-image.png");
|
|
16532
16297
|
});
|
|
16533
16298
|
|
|
@@ -16536,11 +16301,9 @@ describe("$compile", () => {
|
|
|
16536
16301
|
element = $compile('<img ng-attr-data-src="{{name}}">')($rootScope);
|
|
16537
16302
|
expect(element.attr("data-src")).toBeUndefined();
|
|
16538
16303
|
|
|
16539
|
-
$rootScope.$digest();
|
|
16540
16304
|
expect(element.attr("data-src")).toBe("some-image.png");
|
|
16541
16305
|
|
|
16542
16306
|
$rootScope.name = "other-image.png";
|
|
16543
|
-
$rootScope.$digest();
|
|
16544
16307
|
expect(element.attr("data-src")).toBe("other-image.png");
|
|
16545
16308
|
});
|
|
16546
16309
|
|
|
@@ -16551,12 +16314,10 @@ describe("$compile", () => {
|
|
|
16551
16314
|
)($rootScope);
|
|
16552
16315
|
expect(element.attr("data-src")).toBeUndefined();
|
|
16553
16316
|
|
|
16554
|
-
$rootScope.$digest();
|
|
16555
16317
|
expect(element.attr("src")).toBe("constant.png");
|
|
16556
16318
|
expect(element.attr("data-src")).toBe("some-image.png");
|
|
16557
16319
|
|
|
16558
16320
|
$rootScope.name = "other-image.png";
|
|
16559
|
-
$rootScope.$digest();
|
|
16560
16321
|
expect(element.attr("src")).toBe("constant.png");
|
|
16561
16322
|
expect(element.attr("data-src")).toBe("other-image.png");
|
|
16562
16323
|
});
|
|
@@ -16571,7 +16332,6 @@ describe("$compile", () => {
|
|
|
16571
16332
|
expect(element.attr("dash-test")).toBeUndefined();
|
|
16572
16333
|
expect(element.attr("dash-test2")).toBeUndefined();
|
|
16573
16334
|
expect(element.attr("dash-test3")).toBeUndefined();
|
|
16574
|
-
$rootScope.$digest();
|
|
16575
16335
|
expect(element.attr("dash-test")).toBe("JamieMason");
|
|
16576
16336
|
expect(element.attr("dash-test2")).toBe("JamieMason");
|
|
16577
16337
|
expect(element.attr("dash-test3")).toBe("JamieMason");
|
|
@@ -16585,7 +16345,6 @@ describe("$compile", () => {
|
|
|
16585
16345
|
expect(element.attr("dash-test2")).toBeUndefined();
|
|
16586
16346
|
expect(element.attr("dash-test3")).toBeUndefined();
|
|
16587
16347
|
expect(element.attr("dash-test4")).toBeUndefined();
|
|
16588
|
-
$rootScope.$digest();
|
|
16589
16348
|
expect(element.attr("dash-test2")).toBe("JamieMason");
|
|
16590
16349
|
expect(element.attr("dash-test3")).toBe("JamieMason");
|
|
16591
16350
|
expect(element.attr("dash-test4")).toBe("JamieMason");
|
|
@@ -16601,7 +16360,6 @@ describe("$compile", () => {
|
|
|
16601
16360
|
$compile(
|
|
16602
16361
|
'<span data-dash-starter data-on-dash-start="starter"></span>',
|
|
16603
16362
|
)($rootScope);
|
|
16604
|
-
$rootScope.$digest();
|
|
16605
16363
|
expect(log[0]).toEqual("starter");
|
|
16606
16364
|
});
|
|
16607
16365
|
|
|
@@ -16615,7 +16373,6 @@ describe("$compile", () => {
|
|
|
16615
16373
|
$compile('<span data-dash-ender data-on-dash-end="ender"></span>')(
|
|
16616
16374
|
$rootScope,
|
|
16617
16375
|
);
|
|
16618
|
-
$rootScope.$digest();
|
|
16619
16376
|
expect(log[0]).toEqual("ender");
|
|
16620
16377
|
});
|
|
16621
16378
|
});
|
|
@@ -16789,7 +16546,6 @@ describe("$compile", () => {
|
|
|
16789
16546
|
$rootScope,
|
|
16790
16547
|
);
|
|
16791
16548
|
expect(element.attr("view-box")).toBeUndefined();
|
|
16792
|
-
$rootScope.$digest();
|
|
16793
16549
|
expect(element.attr("view-box")).toBe("0 0 0 0");
|
|
16794
16550
|
});
|
|
16795
16551
|
|
|
@@ -16806,8 +16562,6 @@ describe("$compile", () => {
|
|
|
16806
16562
|
"</feSpecularLighting></filter></svg>",
|
|
16807
16563
|
)($rootScope);
|
|
16808
16564
|
expect(element.attr("viewBox")).toBeUndefined();
|
|
16809
|
-
$rootScope.$digest();
|
|
16810
|
-
|
|
16811
16565
|
expect(element.attr("view-box")).toBe("0 0 0 0");
|
|
16812
16566
|
expect(element.find("filter").attr("filter-units")).toBe("0.42");
|
|
16813
16567
|
expect(element.find("feDiffuseLighting").attr("surface-scale")).toBe("1");
|
|
@@ -16826,7 +16580,6 @@ describe("$compile", () => {
|
|
|
16826
16580
|
"<span ng-show-end='show'></span>" +
|
|
16827
16581
|
"</div>",
|
|
16828
16582
|
)($rootScope);
|
|
16829
|
-
$rootScope.$digest();
|
|
16830
16583
|
await wait(100);
|
|
16831
16584
|
const spans = element.find("span");
|
|
16832
16585
|
expect(spans.eq(0)[0].classList.contains("ng-hide")).toBeTrue();
|
|
@@ -16841,7 +16594,6 @@ describe("$compile", () => {
|
|
|
16841
16594
|
"<span ng-repeat-end>{{i}}B;</span>" +
|
|
16842
16595
|
"</div>",
|
|
16843
16596
|
)($rootScope);
|
|
16844
|
-
$rootScope.$digest();
|
|
16845
16597
|
expect(element.text()).toEqual("1A1B;2A2B;");
|
|
16846
16598
|
});
|
|
16847
16599
|
|
|
@@ -16854,7 +16606,6 @@ describe("$compile", () => {
|
|
|
16854
16606
|
"<span ng-repeat-end>{{i}}B;</span>" +
|
|
16855
16607
|
"</div>",
|
|
16856
16608
|
)($rootScope);
|
|
16857
|
-
$rootScope.$digest();
|
|
16858
16609
|
expect(element.text()).toEqual("1A:1B;2A:2B;");
|
|
16859
16610
|
});
|
|
16860
16611
|
|
|
@@ -16866,7 +16617,6 @@ describe("$compile", () => {
|
|
|
16866
16617
|
"<span ng-repeat-end>{{i}}B;</span>" +
|
|
16867
16618
|
"<div></div>",
|
|
16868
16619
|
)($rootScope);
|
|
16869
|
-
$rootScope.$digest();
|
|
16870
16620
|
element = JQLite(element[0].parentNode.childNodes); // reset because repeater is top level.
|
|
16871
16621
|
expect(element.text()).toEqual("1A1B;2A2B;");
|
|
16872
16622
|
});
|
|
@@ -16892,7 +16642,6 @@ describe("$compile", () => {
|
|
|
16892
16642
|
"<div ng-repeat-end>{{i}}B;</div>" +
|
|
16893
16643
|
"<div></div>",
|
|
16894
16644
|
)($rootScope);
|
|
16895
|
-
$rootScope.$digest();
|
|
16896
16645
|
element = JQLite(element[0].parentNode.childNodes); // reset because repeater is top level.
|
|
16897
16646
|
expect(element.text()).toEqual("1A..1B;2A..2B;");
|
|
16898
16647
|
});
|
|
@@ -16907,7 +16656,6 @@ describe("$compile", () => {
|
|
|
16907
16656
|
"<div ng-repeat-end>){{i}};</div>" +
|
|
16908
16657
|
"<div></div>",
|
|
16909
16658
|
)($rootScope);
|
|
16910
|
-
$rootScope.$digest();
|
|
16911
16659
|
element = JQLite(element[0].parentNode.childNodes); // reset because repeater is top level.
|
|
16912
16660
|
expect(element.text()).toEqual("1(2-23-3)1;2(2-23-3)2;");
|
|
16913
16661
|
});
|
|
@@ -17112,8 +16860,6 @@ describe("$compile", () => {
|
|
|
17112
16860
|
"</div>",
|
|
17113
16861
|
)($rootScope);
|
|
17114
16862
|
|
|
17115
|
-
$rootScope.$digest();
|
|
17116
|
-
|
|
17117
16863
|
expect(element.text()).toBe("XY");
|
|
17118
16864
|
///expect(angular.element(element[0].firstChild).data("x")).toBe("abc");
|
|
17119
16865
|
});
|
|
@@ -17140,7 +16886,6 @@ describe("$compile", () => {
|
|
|
17140
16886
|
"<span ng-show-end></span>" +
|
|
17141
16887
|
"</div>",
|
|
17142
16888
|
)($rootScope);
|
|
17143
|
-
$rootScope.$digest();
|
|
17144
16889
|
await wait(100);
|
|
17145
16890
|
const spans = element.find("span");
|
|
17146
16891
|
expect(spans.eq(0)[0].classList.contains("ng-hide")).toBeTrue();
|
|
@@ -17159,13 +16904,13 @@ describe("$compile", () => {
|
|
|
17159
16904
|
// const element = JQLite('<div class="{{val1}} {{val2}} fire"></div>');
|
|
17160
16905
|
// $compile(element)($rootScope);
|
|
17161
16906
|
|
|
17162
|
-
//
|
|
16907
|
+
// ;
|
|
17163
16908
|
|
|
17164
16909
|
// expect(element[0].classList.contains("fire")).toBe(true);
|
|
17165
16910
|
|
|
17166
16911
|
// $rootScope.val1 = "ice";
|
|
17167
16912
|
// $rootScope.val2 = "rice";
|
|
17168
|
-
//
|
|
16913
|
+
// ;
|
|
17169
16914
|
|
|
17170
16915
|
// data = $animate.queue.shift();
|
|
17171
16916
|
// expect(data.event).toBe("addClass");
|
|
@@ -17176,7 +16921,7 @@ describe("$compile", () => {
|
|
|
17176
16921
|
// expect(element[0].classList.contains("fire")).toBe(true);
|
|
17177
16922
|
|
|
17178
16923
|
// $rootScope.val2 = "dice";
|
|
17179
|
-
//
|
|
16924
|
+
// ;
|
|
17180
16925
|
|
|
17181
16926
|
// data = $animate.queue.shift();
|
|
17182
16927
|
// expect(data.event).toBe("addClass");
|
|
@@ -17192,7 +16937,7 @@ describe("$compile", () => {
|
|
|
17192
16937
|
|
|
17193
16938
|
// $rootScope.val1 = "";
|
|
17194
16939
|
// $rootScope.val2 = "";
|
|
17195
|
-
//
|
|
16940
|
+
// ;
|
|
17196
16941
|
|
|
17197
16942
|
// data = $animate.queue.shift();
|
|
17198
16943
|
// expect(data.event).toBe("removeClass");
|
|
@@ -17257,7 +17002,7 @@ describe("$compile", () => {
|
|
|
17257
17002
|
const toCompile = JQLite(template);
|
|
17258
17003
|
|
|
17259
17004
|
const preCompiledChildren = getAll(toCompile);
|
|
17260
|
-
forEach(
|
|
17005
|
+
Object.entries(preCompiledChildren).forEach(([i, element]) => {
|
|
17261
17006
|
getOrSetCacheData(element, "foo", `template#${i}`);
|
|
17262
17007
|
});
|
|
17263
17008
|
|
|
@@ -17265,10 +17010,11 @@ describe("$compile", () => {
|
|
|
17265
17010
|
$rootScope.$apply();
|
|
17266
17011
|
linkedElements.remove();
|
|
17267
17012
|
|
|
17268
|
-
forEach(
|
|
17013
|
+
Object.entries(preCompiledChildren).forEach(([i, element]) => {
|
|
17269
17014
|
expect(CACHE.has(element[EXPANDO])).toBe(false, `template#${i}`);
|
|
17270
17015
|
});
|
|
17271
|
-
|
|
17016
|
+
|
|
17017
|
+
Object.entries(linkedElements).forEach(([i, element]) => {
|
|
17272
17018
|
expect(CACHE.has(element[EXPANDO])).toBe(false, `linked#${i}`);
|
|
17273
17019
|
});
|
|
17274
17020
|
}
|