@angular-wave/angular.ts 0.0.1 → 0.0.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/Makefile +1 -1
- package/dist/angular-ts.cjs.js +506 -1696
- package/dist/angular-ts.esm.js +506 -1696
- package/dist/angular-ts.umd.js +506 -1696
- package/package.json +1 -1
- package/public/README.md +1 -0
- package/src/animations/{animateCss.js → animate-css.js} +0 -1
- package/src/animations/animation.js +428 -431
- package/src/animations/module.js +9 -9
- package/src/core/cache.js +2 -0
- package/src/core/compile.js +6 -1102
- package/src/core/compile.md +1192 -0
- package/src/core/location.js +1 -1
- package/src/core/utils.js +1 -1
- package/src/directive/a.js +1 -1
- package/src/directive/attrs.js +1 -1
- package/src/directive/csp.md +89 -0
- package/src/directive/input.js +3 -3
- package/src/directive/{ngModel.js → model.js} +1 -1
- package/src/directive/select.js +5 -5
- package/src/jqLite.js +1 -22
- package/src/public.js +24 -24
- package/src/services/log.js +66 -116
- package/src/services/log.md +39 -0
- package/test/jqlite.spec.js +5 -35
- package/test/messages/messages.spec.js +1 -1
- package/test/ng/compile.spec.js +17 -16
- package/test/ng/directive/model-options.spec.js +1 -1
- package/test/ng/directive/model.spec.js +1 -1
- package/test/ng/directive/options.spec.js +61 -61
- package/test/ng/directive/select.spec.js +22 -22
- package/test/ng/http-backend.spec.js +1 -1
- package/test/ng/on.spec.js +1 -1
- package/test/ng/prop.spec.js +54 -62
- package/test/ng/sanitize-uri.spec.js +1 -1
- package/test/ng/scope.spec.js +1 -1
- package/test/original-test.html +1 -1
- package/types/jqlite.d.ts +1 -32
- package/dist/build/angular-mocks.js +0 -3757
- package/dist/build/angular-parse-ext.js +0 -1275
- package/dist/build/angular-resource.js +0 -911
- package/dist/build/angular-touch.js +0 -368
- package/src/core/attributes.js +0 -199
- package/src/directive/ngCsp.js +0 -82
- /package/{dist/build → legacy}/angular-animate.js +0 -0
- /package/{dist/build → legacy}/angular-aria.js +0 -0
- /package/{dist/build → legacy}/angular-message-format.js +0 -0
- /package/{dist/build → legacy}/angular-messages.js +0 -0
- /package/{dist/build → legacy}/angular-route.js +0 -0
- /package/{dist/build → legacy}/angular-sanitize.js +0 -0
- /package/{dist/build → legacy}/angular.js +0 -0
- /package/src/animations/{animateCache.js → animate-cache.js} +0 -0
- /package/src/animations/{animateChildrenDirective.js → animate-children-directive.js} +0 -0
- /package/src/animations/{animateCssDriver.js → animate-css-driver.js} +0 -0
- /package/src/animations/{animateJsDriver.js → animate-js-driver.js} +0 -0
- /package/src/animations/{animateJs.js → animate-js.js} +0 -0
- /package/src/animations/{animateQueue.js → animate-queue.js} +0 -0
- /package/src/animations/{ngAnimateSwap.js → animate-swap.js} +0 -0
- /package/src/animations/{rafScheduler.js → raf-scheduler.js} +0 -0
- /package/src/core/{animateCss.js → animate-css.js} +0 -0
- /package/src/core/{animateRunner.js → animate-runner.js} +0 -0
- /package/src/core/{exceptionHandler.js → exception-handler.js} +0 -0
- /package/src/core/{intervalFactory.js → interval-factory.js} +0 -0
- /package/src/core/{rootScope.js → root-scope.js} +0 -0
- /package/src/core/{sanitizeUri.js → sanitize-uri.js} +0 -0
- /package/src/core/{taskTrackerFactory.js → task-tracker-factory.js} +0 -0
- /package/src/directive/{ngClass.js → class.js} +0 -0
- /package/src/directive/{ngController.js → controller.js} +0 -0
- /package/src/directive/{ngIf.js → if.js} +0 -0
- /package/src/directive/{ngInclude.js → include.js} +0 -0
- /package/src/directive/{ngModelOptions.js → model-options.js} +0 -0
- /package/src/directive/{ngOptions.js → options.js} +0 -0
- /package/src/directive/{ngRef.js → ref.js} +0 -0
- /package/src/directive/{ngRepeat.js → repeat.js} +0 -0
- /package/src/directive/{ngShowHide.js → show-hide.js} +0 -0
- /package/src/directive/{ngSwitch.js → switch.js} +0 -0
- /package/src/directive/{ngTransclude.js → transclude.js} +0 -0
- /package/src/{routeToRegExp.js → route-to-reg-exp.js} +0 -0
- /package/src/services/{anchorScroll.js → anchor-scroll.js} +0 -0
- /package/src/services/{cacheFactory.js → cache-factory.js} +0 -0
- /package/src/services/{cookieReader.js → cookie-reader.js} +0 -0
- /package/src/services/{httpBackend.js → http-backend.js} +0 -0
- /package/src/services/{templateRequest.js → template-request.js} +0 -0
- /package/test/ng/{anomate.spec.js → animate.spec.js} +0 -0
package/test/ng/on.spec.js
CHANGED
|
@@ -129,7 +129,7 @@ describe("ngOn* event binding", () => {
|
|
|
129
129
|
$rootScope.$digest();
|
|
130
130
|
element.triggerHandler("asdf");
|
|
131
131
|
expect(cb).toHaveBeenCalled();
|
|
132
|
-
expect(element.
|
|
132
|
+
expect(element[0].asdf).toBe(123);
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
it("should use the full ng-on-* attribute name in $attr mappings", () => {
|
package/test/ng/prop.spec.js
CHANGED
|
@@ -31,49 +31,49 @@ describe("ngProp*", () => {
|
|
|
31
31
|
'<button ng-prop-disabled="isDisabled">Button</button>',
|
|
32
32
|
)($rootScope);
|
|
33
33
|
$rootScope.$digest();
|
|
34
|
-
expect(element.
|
|
34
|
+
expect(element[0].disabled).toBe(false);
|
|
35
35
|
$rootScope.isDisabled = true;
|
|
36
36
|
$rootScope.$digest();
|
|
37
|
-
expect(element.
|
|
37
|
+
expect(element[0].disabled).toBe(true);
|
|
38
38
|
$rootScope.isDisabled = false;
|
|
39
39
|
$rootScope.$digest();
|
|
40
|
-
expect(element.
|
|
40
|
+
expect(element[0].disabled).toBe(false);
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
it("should bind boolean properties (input checked)", () => {
|
|
44
44
|
const element = $compile(
|
|
45
45
|
'<input type="checkbox" ng-prop-checked="isChecked" />',
|
|
46
46
|
)($rootScope);
|
|
47
|
-
expect(element.
|
|
47
|
+
expect(element[0].checked).toBe(false);
|
|
48
48
|
$rootScope.isChecked = true;
|
|
49
49
|
$rootScope.$digest();
|
|
50
|
-
expect(element.
|
|
50
|
+
expect(element[0].checked).toBe(true);
|
|
51
51
|
$rootScope.isChecked = false;
|
|
52
52
|
$rootScope.$digest();
|
|
53
|
-
expect(element.
|
|
53
|
+
expect(element[0].checked).toBe(false);
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
it("should bind string properties (title)", () => {
|
|
57
57
|
const element = $compile('<span ng-prop-title="title" />')($rootScope);
|
|
58
58
|
$rootScope.title = 123;
|
|
59
59
|
$rootScope.$digest();
|
|
60
|
-
expect(element.
|
|
60
|
+
expect(element[0].title).toBe("123");
|
|
61
61
|
$rootScope.title = "foobar";
|
|
62
62
|
$rootScope.$digest();
|
|
63
|
-
expect(element.
|
|
63
|
+
expect(element[0].title).toBe("foobar");
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
it("should bind variable type properties", () => {
|
|
67
67
|
const element = $compile('<span ng-prop-asdf="asdf" />')($rootScope);
|
|
68
68
|
$rootScope.asdf = 123;
|
|
69
69
|
$rootScope.$digest();
|
|
70
|
-
expect(element.
|
|
70
|
+
expect(element[0].asdf).toBe(123);
|
|
71
71
|
$rootScope.asdf = "foobar";
|
|
72
72
|
$rootScope.$digest();
|
|
73
|
-
expect(element.
|
|
73
|
+
expect(element[0].asdf).toBe("foobar");
|
|
74
74
|
$rootScope.asdf = true;
|
|
75
75
|
$rootScope.$digest();
|
|
76
|
-
expect(element.
|
|
76
|
+
expect(element[0].asdf).toBe(true);
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
// https://github.com/angular/angular.js/issues/16797
|
|
@@ -82,24 +82,24 @@ describe("ngProp*", () => {
|
|
|
82
82
|
// Initialize to truthy value
|
|
83
83
|
$rootScope.myText = "abc";
|
|
84
84
|
$rootScope.$digest();
|
|
85
|
-
expect(element.
|
|
85
|
+
expect(element[0].text).toBe("abc");
|
|
86
86
|
|
|
87
87
|
// Assert various falsey values get assigned to the property
|
|
88
88
|
$rootScope.myText = "";
|
|
89
89
|
$rootScope.$digest();
|
|
90
|
-
expect(element.
|
|
90
|
+
expect(element[0].text).toBe("");
|
|
91
91
|
$rootScope.myText = 0;
|
|
92
92
|
$rootScope.$digest();
|
|
93
|
-
expect(element.
|
|
93
|
+
expect(element[0].text).toBe(0);
|
|
94
94
|
$rootScope.myText = false;
|
|
95
95
|
$rootScope.$digest();
|
|
96
|
-
expect(element.
|
|
96
|
+
expect(element[0].text).toBe(false);
|
|
97
97
|
$rootScope.myText = undefined;
|
|
98
98
|
$rootScope.$digest();
|
|
99
|
-
expect(element.
|
|
99
|
+
expect(element[0].text).toBeUndefined();
|
|
100
100
|
$rootScope.myText = null;
|
|
101
101
|
$rootScope.$digest();
|
|
102
|
-
expect(element.
|
|
102
|
+
expect(element[0].text).toBe(null);
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
it("should directly map special properties (class)", () => {
|
|
@@ -110,19 +110,11 @@ describe("ngProp*", () => {
|
|
|
110
110
|
expect(element[0]).not.toHaveClass("abc");
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
it("should not use jQuery .prop() to avoid jQuery propFix/hooks", () => {
|
|
114
|
-
const element = $compile('<span ng-prop-class="myText" />')($rootScope);
|
|
115
|
-
spyOn(jqLite.prototype, "prop");
|
|
116
|
-
$rootScope.myText = "abc";
|
|
117
|
-
$rootScope.$digest();
|
|
118
|
-
expect(jqLite.prototype.prop).not.toHaveBeenCalled();
|
|
119
|
-
});
|
|
120
|
-
|
|
121
113
|
it("should support mixed case using underscore-separated names", () => {
|
|
122
114
|
const element = $compile('<span ng-prop-a_bcd_e="value" />')($rootScope);
|
|
123
115
|
$rootScope.value = 123;
|
|
124
116
|
$rootScope.$digest();
|
|
125
|
-
expect(element.
|
|
117
|
+
expect(element[0].aBcdE).toBe(123);
|
|
126
118
|
});
|
|
127
119
|
|
|
128
120
|
it("should work with different prefixes", () => {
|
|
@@ -130,9 +122,9 @@ describe("ngProp*", () => {
|
|
|
130
122
|
const element = $compile(
|
|
131
123
|
'<span ng:prop:test="name" ng-Prop-test2="name" ng_Prop_test3="name"></span>',
|
|
132
124
|
)($rootScope);
|
|
133
|
-
expect(element.
|
|
134
|
-
expect(element.
|
|
135
|
-
expect(element.
|
|
125
|
+
expect(element[0].test).toBe("Misko");
|
|
126
|
+
expect(element[0].test2).toBe("Misko");
|
|
127
|
+
expect(element[0].test3).toBe("Misko");
|
|
136
128
|
});
|
|
137
129
|
|
|
138
130
|
it('should work with the "href" property', () => {
|
|
@@ -141,7 +133,7 @@ describe("ngProp*", () => {
|
|
|
141
133
|
$rootScope,
|
|
142
134
|
);
|
|
143
135
|
$rootScope.$digest();
|
|
144
|
-
expect(element.
|
|
136
|
+
expect(element[0].href).toMatch(/\/test\/test$/);
|
|
145
137
|
});
|
|
146
138
|
|
|
147
139
|
it("should work if they are prefixed with x- or data- and different prefixes", () => {
|
|
@@ -150,11 +142,11 @@ describe("ngProp*", () => {
|
|
|
150
142
|
'<span data-ng-prop-test2="name" x-ng-prop-test3="name" data-ng:prop-test4="name" ' +
|
|
151
143
|
'x_ng-prop-test5="name" data:ng-prop-test6="name"></span>',
|
|
152
144
|
)($rootScope);
|
|
153
|
-
expect(element.
|
|
154
|
-
expect(element.
|
|
155
|
-
expect(element.
|
|
156
|
-
expect(element.
|
|
157
|
-
expect(element.
|
|
145
|
+
expect(element[0].test2).toBe("Misko");
|
|
146
|
+
expect(element[0].test3).toBe("Misko");
|
|
147
|
+
expect(element[0].test4).toBe("Misko");
|
|
148
|
+
expect(element[0].test5).toBe("Misko");
|
|
149
|
+
expect(element[0].test6).toBe("Misko");
|
|
158
150
|
});
|
|
159
151
|
|
|
160
152
|
it("should work independently of attributes with the same name", () => {
|
|
@@ -163,7 +155,7 @@ describe("ngProp*", () => {
|
|
|
163
155
|
);
|
|
164
156
|
$rootScope.asdf = 123;
|
|
165
157
|
$rootScope.$digest();
|
|
166
|
-
expect(element.
|
|
158
|
+
expect(element[0].asdf).toBe(123);
|
|
167
159
|
expect(element.attr("asdf")).toBe("foo");
|
|
168
160
|
});
|
|
169
161
|
|
|
@@ -173,7 +165,7 @@ describe("ngProp*", () => {
|
|
|
173
165
|
);
|
|
174
166
|
$rootScope.asdf = 123;
|
|
175
167
|
$rootScope.$digest();
|
|
176
|
-
expect(element.
|
|
168
|
+
expect(element[0].asdf).toBe(123);
|
|
177
169
|
expect(element.attr("asdf")).toBe("foo");
|
|
178
170
|
});
|
|
179
171
|
|
|
@@ -239,15 +231,15 @@ describe("ngProp*", () => {
|
|
|
239
231
|
it("should process property bindings in pre-linking phase at priority 100", () => {
|
|
240
232
|
compileProvider.directive("propLog", () => ({
|
|
241
233
|
compile($element, $attrs) {
|
|
242
|
-
logs.push(`compile=${$element.
|
|
234
|
+
logs.push(`compile=${$element[0].myName}`);
|
|
243
235
|
|
|
244
236
|
return {
|
|
245
237
|
pre($scope, $element, $attrs) {
|
|
246
|
-
logs.push(`preLinkP0=${$element.
|
|
238
|
+
logs.push(`preLinkP0=${$element[0].myName}`);
|
|
247
239
|
$rootScope.name = "pre0";
|
|
248
240
|
},
|
|
249
241
|
post($scope, $element, $attrs) {
|
|
250
|
-
logs.push(`postLink=${$element.
|
|
242
|
+
logs.push(`postLink=${$element[0].myName}`);
|
|
251
243
|
$rootScope.name = "post0";
|
|
252
244
|
},
|
|
253
245
|
};
|
|
@@ -259,7 +251,7 @@ describe("ngProp*", () => {
|
|
|
259
251
|
compile() {
|
|
260
252
|
return {
|
|
261
253
|
pre($scope, $element, $attrs) {
|
|
262
|
-
logs.push(`preLinkP101=${$element.
|
|
254
|
+
logs.push(`preLinkP101=${$element[0].myName}`);
|
|
263
255
|
$rootScope.name = "pre101";
|
|
264
256
|
},
|
|
265
257
|
};
|
|
@@ -270,7 +262,7 @@ describe("ngProp*", () => {
|
|
|
270
262
|
)($rootScope);
|
|
271
263
|
$rootScope.name = "loader";
|
|
272
264
|
$rootScope.$apply();
|
|
273
|
-
logs.push(`digest=${element.
|
|
265
|
+
logs.push(`digest=${element[0].myName}`);
|
|
274
266
|
expect(logs.join("; ")).toEqual(
|
|
275
267
|
"compile=undefined; preLinkP101=undefined; preLinkP0=pre101; postLink=pre101; digest=loader",
|
|
276
268
|
);
|
|
@@ -283,7 +275,7 @@ describe("ngProp*", () => {
|
|
|
283
275
|
// So for the test use something different
|
|
284
276
|
$rootScope.testUrl = $sce.trustAsMediaUrl("someuntrustedthing:foo();");
|
|
285
277
|
$rootScope.$digest();
|
|
286
|
-
expect(element.
|
|
278
|
+
expect(element[0].src).toEqual("someuntrustedthing:foo();");
|
|
287
279
|
});
|
|
288
280
|
|
|
289
281
|
it("should use $$sanitizeUri", () => {
|
|
@@ -303,7 +295,7 @@ describe("ngProp*", () => {
|
|
|
303
295
|
$rootScope.testUrl = "someUrl";
|
|
304
296
|
|
|
305
297
|
$rootScope.$apply();
|
|
306
|
-
expect(element.
|
|
298
|
+
expect(element[0].src).toMatch(/^http:\/\/.*\/someSanitizedUrl$/);
|
|
307
299
|
expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, true);
|
|
308
300
|
});
|
|
309
301
|
|
|
@@ -326,7 +318,7 @@ describe("ngProp*", () => {
|
|
|
326
318
|
// protocol name.
|
|
327
319
|
$rootScope.testUrl = $sce.trustAsMediaUrl("untrusted:foo();");
|
|
328
320
|
$rootScope.$apply();
|
|
329
|
-
expect(element.
|
|
321
|
+
expect(element[0].src).toBe("untrusted:foo();");
|
|
330
322
|
});
|
|
331
323
|
});
|
|
332
324
|
|
|
@@ -335,33 +327,33 @@ describe("ngProp*", () => {
|
|
|
335
327
|
$rootScope.testUrl = "http://example.com/image.png"; // `http` is trusted
|
|
336
328
|
let element = $compile('<a ng-prop-href="testUrl"></a>')($rootScope);
|
|
337
329
|
$rootScope.$digest();
|
|
338
|
-
expect(element.
|
|
330
|
+
expect(element[0].href).toEqual("http://example.com/image.png");
|
|
339
331
|
|
|
340
332
|
element = $compile('<a ng-prop-href="testUrl"></a>')($rootScope);
|
|
341
333
|
$rootScope.$digest();
|
|
342
|
-
expect(element.
|
|
334
|
+
expect(element[0].href).toEqual("http://example.com/image.png");
|
|
343
335
|
});
|
|
344
336
|
|
|
345
337
|
it("should accept trusted values for non-trusted URI values", () => {
|
|
346
338
|
$rootScope.testUrl = $sce.trustAsUrl("javascript:foo()"); // `javascript` is not trusted
|
|
347
339
|
let element = $compile('<a ng-prop-href="testUrl"></a>')($rootScope);
|
|
348
340
|
$rootScope.$digest();
|
|
349
|
-
expect(element.
|
|
341
|
+
expect(element[0].href).toEqual("javascript:foo()");
|
|
350
342
|
|
|
351
343
|
element = $compile('<a ng-prop-href="testUrl"></a>')($rootScope);
|
|
352
344
|
$rootScope.$digest();
|
|
353
|
-
expect(element.
|
|
345
|
+
expect(element[0].href).toEqual("javascript:foo()");
|
|
354
346
|
});
|
|
355
347
|
|
|
356
348
|
it("should sanitize non-trusted values", () => {
|
|
357
349
|
$rootScope.testUrl = "javascript:foo()"; // `javascript` is not trusted
|
|
358
350
|
let element = $compile('<a ng-prop-href="testUrl"></a>')($rootScope);
|
|
359
351
|
$rootScope.$digest();
|
|
360
|
-
expect(element.
|
|
352
|
+
expect(element[0].href).toEqual("unsafe:javascript:foo()");
|
|
361
353
|
|
|
362
354
|
element = $compile('<a ng-prop-href="testUrl"></a>')($rootScope);
|
|
363
355
|
$rootScope.$digest();
|
|
364
|
-
expect(element.
|
|
356
|
+
expect(element[0].href).toEqual("unsafe:javascript:foo()");
|
|
365
357
|
});
|
|
366
358
|
|
|
367
359
|
it("should not sanitize href on elements other than anchor", () => {
|
|
@@ -371,7 +363,7 @@ describe("ngProp*", () => {
|
|
|
371
363
|
$rootScope.testUrl = "javascript:doEvilStuff()";
|
|
372
364
|
$rootScope.$apply();
|
|
373
365
|
|
|
374
|
-
expect(element.
|
|
366
|
+
expect(element[0].href).toBe("javascript:doEvilStuff()");
|
|
375
367
|
});
|
|
376
368
|
|
|
377
369
|
it("should not sanitize properties other then those configured", () => {
|
|
@@ -379,7 +371,7 @@ describe("ngProp*", () => {
|
|
|
379
371
|
$rootScope.testUrl = "javascript:doEvilStuff()";
|
|
380
372
|
$rootScope.$apply();
|
|
381
373
|
|
|
382
|
-
expect(element.
|
|
374
|
+
expect(element[0].title).toBe("javascript:doEvilStuff()");
|
|
383
375
|
});
|
|
384
376
|
|
|
385
377
|
it("should use $$sanitizeUri", () => {
|
|
@@ -398,14 +390,14 @@ describe("ngProp*", () => {
|
|
|
398
390
|
let element = $compile('<a ng-prop-href="testUrl"></a>')($rootScope);
|
|
399
391
|
$rootScope.testUrl = "someUrl";
|
|
400
392
|
$rootScope.$apply();
|
|
401
|
-
expect(element.
|
|
393
|
+
expect(element[0].href).toMatch(/^http:\/\/.*\/someSanitizedUrl$/);
|
|
402
394
|
expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, false);
|
|
403
395
|
|
|
404
396
|
$$sanitizeUri.calls.reset();
|
|
405
397
|
|
|
406
398
|
element = $compile('<a ng-prop-href="testUrl"></a>')($rootScope);
|
|
407
399
|
$rootScope.$apply();
|
|
408
|
-
expect(element.
|
|
400
|
+
expect(element[0].href).toMatch(/^http:\/\/.*\/someSanitizedUrl$/);
|
|
409
401
|
expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, false);
|
|
410
402
|
});
|
|
411
403
|
|
|
@@ -443,7 +435,7 @@ describe("ngProp*", () => {
|
|
|
443
435
|
);
|
|
444
436
|
$rootScope.testUrl = "different_page";
|
|
445
437
|
$rootScope.$apply();
|
|
446
|
-
expect(element.
|
|
438
|
+
expect(element[0].src).toMatch(/\/different_page$/);
|
|
447
439
|
});
|
|
448
440
|
|
|
449
441
|
it("should clear out src properties for a different domain", () => {
|
|
@@ -485,7 +477,7 @@ describe("ngProp*", () => {
|
|
|
485
477
|
);
|
|
486
478
|
$rootScope.$apply();
|
|
487
479
|
|
|
488
|
-
expect(element.
|
|
480
|
+
expect(element[0].src).toEqual("javascript:doTrustedStuff()");
|
|
489
481
|
});
|
|
490
482
|
});
|
|
491
483
|
|
|
@@ -503,7 +495,7 @@ describe("ngProp*", () => {
|
|
|
503
495
|
|
|
504
496
|
$rootScope.testUrl = $sce.trustAsResourceUrl("https://example.com/");
|
|
505
497
|
$rootScope.$apply();
|
|
506
|
-
expect(element.
|
|
498
|
+
expect(element[0].href).toContain("https://example.com/");
|
|
507
499
|
|
|
508
500
|
$rootScope.testUrl = "https://not.example.com/";
|
|
509
501
|
expect(() => {
|
|
@@ -527,7 +519,7 @@ describe("ngProp*", () => {
|
|
|
527
519
|
);
|
|
528
520
|
$rootScope.testUrl = "different_page";
|
|
529
521
|
$rootScope.$apply();
|
|
530
|
-
expect(element.
|
|
522
|
+
expect(element[0].action).toMatch(/\/different_page$/);
|
|
531
523
|
});
|
|
532
524
|
|
|
533
525
|
it("should clear out action property for a different domain", () => {
|
|
@@ -569,7 +561,7 @@ describe("ngProp*", () => {
|
|
|
569
561
|
);
|
|
570
562
|
$rootScope.$apply();
|
|
571
563
|
|
|
572
|
-
expect(element.
|
|
564
|
+
expect(element[0].action).toEqual("javascript:doTrustedStuff()");
|
|
573
565
|
});
|
|
574
566
|
});
|
|
575
567
|
|
|
@@ -599,13 +591,13 @@ describe("ngProp*", () => {
|
|
|
599
591
|
|
|
600
592
|
$rootScope.testUrl = "./css1.css";
|
|
601
593
|
$rootScope.$apply();
|
|
602
|
-
expect(element.
|
|
594
|
+
expect(element[0].href).toContain("css1.css");
|
|
603
595
|
|
|
604
596
|
$rootScope.testUrl = $sce.trustAsResourceUrl(
|
|
605
597
|
"https://elsewhere.example.org/css2.css",
|
|
606
598
|
);
|
|
607
599
|
$rootScope.$apply();
|
|
608
|
-
expect(element.
|
|
600
|
+
expect(element[0].href).toContain(
|
|
609
601
|
"https://elsewhere.example.org/css2.css",
|
|
610
602
|
);
|
|
611
603
|
});
|
package/test/ng/scope.spec.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getQueues } from "../../src/core/
|
|
1
|
+
import { getQueues } from "../../src/core/root-scope";
|
|
2
2
|
import { extend, sliceArgs } from "../../src/core/utils";
|
|
3
3
|
import { publishExternalAPI } from "../../src/public";
|
|
4
4
|
import { createInjector } from "../../src/injector";
|
package/test/original-test.html
CHANGED
package/types/jqlite.d.ts
CHANGED
|
@@ -352,38 +352,7 @@ interface JQLite {
|
|
|
352
352
|
* @see {@link https://api.jquery.com/prepend/#prepend-function}
|
|
353
353
|
*/
|
|
354
354
|
prepend(func: (index: number, html: string) => string | Element | JQLite): this;
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Get the value of a property for the first element in the set of matched elements.
|
|
358
|
-
*
|
|
359
|
-
* @param propertyName The name of the property to get.
|
|
360
|
-
* @see {@link https://api.jquery.com/prop/#prop-propertyName}
|
|
361
|
-
*/
|
|
362
|
-
prop(propertyName: string): any;
|
|
363
|
-
/**
|
|
364
|
-
* Set one or more properties for the set of matched elements.
|
|
365
|
-
*
|
|
366
|
-
* @param propertyName The name of the property to set.
|
|
367
|
-
* @param value A value to set for the property.
|
|
368
|
-
* @see {@link https://api.jquery.com/prop/#prop-propertyName-value}
|
|
369
|
-
*/
|
|
370
|
-
prop(propertyName: string, value: string | number | boolean): this;
|
|
371
|
-
/**
|
|
372
|
-
* Set one or more properties for the set of matched elements.
|
|
373
|
-
*
|
|
374
|
-
* @param properties An object of property-value pairs to set.
|
|
375
|
-
* @see {@link https://api.jquery.com/prop/#prop-properties}
|
|
376
|
-
*/
|
|
377
|
-
prop(properties: Object): this;
|
|
378
|
-
/**
|
|
379
|
-
* Set one or more properties for the set of matched elements.
|
|
380
|
-
*
|
|
381
|
-
* @param propertyName The name of the property to set.
|
|
382
|
-
* @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.
|
|
383
|
-
* @see {@link https://api.jquery.com/prop/#prop-propertyName-function}
|
|
384
|
-
*/
|
|
385
|
-
prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): this;
|
|
386
|
-
|
|
355
|
+
|
|
387
356
|
/**
|
|
388
357
|
* Remove the set of matched elements from the DOM.
|
|
389
358
|
*
|