@angular-wave/angular.ts 0.8.2 → 0.8.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/@types/interface.d.ts +3 -2
- package/@types/services/sce/sce.d.ts +0 -8
- package/dist/angular-ts.esm.js +29 -24
- package/dist/angular-ts.umd.js +29 -24
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/layouts/shortcodes/version.html +1 -1
- package/docs/static/typedoc/assets/hierarchy.js +1 -1
- package/docs/static/typedoc/assets/navigation.js +1 -1
- package/docs/static/typedoc/assets/search.js +1 -1
- package/docs/static/typedoc/assets/style.css +9 -2
- package/docs/static/typedoc/hierarchy.html +1 -1
- package/docs/static/typedoc/index.html +1 -1
- package/docs/static/typedoc/interfaces/HttpProviderDefaults.html +1 -1
- package/docs/static/typedoc/interfaces/RequestConfig.html +1 -1
- package/docs/static/typedoc/interfaces/RequestShortcutConfig.html +1 -1
- package/docs/static/typedoc/types/Injectable.html +1 -1
- package/docs/static/typedoc/types/InjectableClass.html +1 -0
- package/package.json +1 -1
- package/src/animations/animations.test.js +1 -1
- package/src/binding.test.js +1 -1
- package/src/core/compile/compile.spec.js +2 -2
- package/src/core/compile/compile.test.js +1 -1
- package/src/core/controller/controller.test.js +1 -1
- package/src/core/core.test.js +1 -1
- package/src/core/di/injector.test.js +1 -1
- package/src/core/di/ng-module.test.js +1 -1
- package/src/core/filter/filter.test.js +1 -1
- package/src/core/interpolate/interpolate.test.js +1 -1
- package/src/core/parse/ast/ast.test.js +1 -1
- package/src/core/parse/interpreter.js +23 -8
- package/src/core/parse/lexer/lexer.test.js +1 -1
- package/src/core/parse/parse.test.js +1 -1
- package/src/core/parse/parser/parser.test.js +1 -1
- package/src/core/sanitize/sanitize-uri.test.js +1 -1
- package/src/core/scope/scope.js +3 -9
- package/src/core/scope/scope.spec.js +2 -2
- package/src/core/scope/scope.test.js +12 -0
- package/src/directive/aria/aria.test.js +1 -1
- package/src/directive/attrs/attrs.test.js +1 -1
- package/src/directive/attrs/boolean.test.js +1 -1
- package/src/directive/attrs/element-style.test.js +1 -1
- package/src/directive/attrs/src.test.js +1 -1
- package/src/directive/bind/bind.test.js +1 -1
- package/src/directive/channel/channel.test.js +1 -1
- package/src/directive/class/class-test.html +23 -0
- package/src/directive/class/class.test.js +1 -1
- package/src/directive/cloak/cloak.test.js +1 -1
- package/src/directive/controller/controller.test.js +1 -1
- package/src/directive/events/events.test.js +1 -1
- package/src/directive/form/form.test.js +1 -1
- package/src/directive/http/http.test.js +1 -1
- package/src/directive/if/if.test.js +1 -1
- package/src/directive/include/include.test.js +1 -1
- package/src/directive/init/init.test.js +1 -1
- package/src/directive/input/input.test.js +1 -1
- package/src/directive/messages/messages.spec.js +6 -5
- package/src/directive/messages/messages.test.js +2 -2
- package/src/directive/model/model.test.js +1 -1
- package/src/directive/model-options/model-option.test.js +1 -1
- package/src/directive/non-bindable/non-bindable.test.js +1 -1
- package/src/directive/observe/observe.test.js +1 -1
- package/src/directive/on/on.test.js +1 -1
- package/src/directive/options/options.test.js +1 -1
- package/src/directive/ref/href.test.js +2 -2
- package/src/directive/repeat/repeat.spec.js +61 -61
- package/src/directive/repeat/repeat.test.js +2 -2
- package/src/directive/script/script.test.js +1 -1
- package/src/directive/select/select.test.js +1 -1
- package/src/directive/setter/setter.test.js +1 -1
- package/src/directive/show-hide/show-hide.test.js +1 -1
- package/src/directive/style/style.test.js +1 -1
- package/src/directive/switch/switch.test.js +1 -1
- package/src/directive/validators/validators.test.js +1 -1
- package/src/filters/filters.test.js +1 -1
- package/src/interface.ts +3 -2
- package/src/router/directives/state-directives.test.js +1 -1
- package/src/router/directives/view-directive.spec.js +9 -6
- package/src/router/directives/view-directive.test.js +1 -1
- package/src/router/glob/glob.test.js +1 -1
- package/src/router/router.test.js +1 -1
- package/src/router/state/state.test.js +1 -1
- package/src/router/template-factory.spec.js +1 -4
- package/src/router/template-factory.test.js +1 -1
- package/src/router/url/url.test.js +1 -1
- package/src/router/view/view.test.js +1 -1
- package/src/services/http/http.test.js +1 -1
- package/src/services/http-backend/http-backend.test.js +1 -1
- package/src/services/location/location.test.js +1 -1
- package/src/services/log/log.test.js +1 -1
- package/src/services/pubsub/pubsub.test.js +1 -1
- package/src/services/sce/sce.js +7 -6
- package/src/services/sce/sce.test.js +1 -1
- package/src/services/template-cache/template-cache.test.js +1 -1
- package/src/shared/shared.test.js +1 -1
- package/src/shared/url-utils/url-utils.test.js +1 -1
- package/src/src.test.js +1 -1
- package/src/loader.md +0 -0
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { Angular } from "../../angular.js";
|
|
2
2
|
import { wait } from "../../shared/test-utils.js";
|
|
3
3
|
import { isString } from "../../shared/utils.js";
|
|
4
|
-
import { getController } from "../../shared/dom.js";
|
|
4
|
+
import { dealoc, getController } from "../../shared/dom.js";
|
|
5
5
|
|
|
6
6
|
describe("ngMessages", () => {
|
|
7
|
-
let $rootScope, $compile, $templateCache;
|
|
7
|
+
let $rootScope, $compile, $templateCache, el;
|
|
8
8
|
|
|
9
9
|
beforeEach(() => {
|
|
10
|
+
el = document.getElementById("app");
|
|
11
|
+
dealoc(el);
|
|
10
12
|
window.angular = new Angular();
|
|
11
|
-
window.angular.module("app", [
|
|
13
|
+
window.angular.module("app", []).directive("messageWrap", () => ({
|
|
12
14
|
transclude: true,
|
|
13
15
|
scope: {
|
|
14
16
|
col: "=col",
|
|
15
17
|
},
|
|
16
18
|
template: '<div ng-messages="col"><ng-transclude></ng-transclude></div>',
|
|
17
19
|
}));
|
|
18
|
-
|
|
19
20
|
window.angular
|
|
20
|
-
.bootstrap(
|
|
21
|
+
.bootstrap(el, ["app"])
|
|
21
22
|
.invoke((_$rootScope_, _$compile_, _$templateCache_) => {
|
|
22
23
|
$rootScope = _$rootScope_;
|
|
23
24
|
$compile = _$compile_;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { test, expect } from "@playwright/test";
|
|
2
2
|
|
|
3
|
-
const TEST_URL = "src/directive/messages/messages.html";
|
|
3
|
+
const TEST_URL = "src/directive/messages/messages.html?random=false";
|
|
4
4
|
|
|
5
5
|
test("unit tests contain no errors", async ({ page }) => {
|
|
6
6
|
await page.goto(TEST_URL);
|
|
7
7
|
await page.content();
|
|
8
8
|
await page.waitForTimeout(1000);
|
|
9
9
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
-
/0 failures/,
|
|
10
|
+
/ 0 failures/,
|
|
11
11
|
);
|
|
12
12
|
});
|
|
@@ -5,7 +5,7 @@ test("unit href tests contain no errors", async ({ page }) => {
|
|
|
5
5
|
await page.content();
|
|
6
6
|
await page.waitForTimeout(1000);
|
|
7
7
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
8
|
-
/0 failures/,
|
|
8
|
+
/ 0 failures/,
|
|
9
9
|
);
|
|
10
10
|
});
|
|
11
11
|
|
|
@@ -14,6 +14,6 @@ test("unit ref tests contain no errors", async ({ page }) => {
|
|
|
14
14
|
await page.content();
|
|
15
15
|
await page.waitForTimeout(1000);
|
|
16
16
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
17
|
-
/0 failures/,
|
|
17
|
+
/ 0 failures/,
|
|
18
18
|
);
|
|
19
19
|
});
|
|
@@ -14,6 +14,8 @@ describe("ngRepeat", () => {
|
|
|
14
14
|
let logs = [];
|
|
15
15
|
|
|
16
16
|
beforeEach(() => {
|
|
17
|
+
const el = document.getElementById("app");
|
|
18
|
+
dealoc(el);
|
|
17
19
|
delete window.angular;
|
|
18
20
|
logs = [];
|
|
19
21
|
window.angular = new Angular();
|
|
@@ -26,7 +28,7 @@ describe("ngRepeat", () => {
|
|
|
26
28
|
};
|
|
27
29
|
});
|
|
28
30
|
|
|
29
|
-
injector = window.angular.bootstrap(
|
|
31
|
+
injector = window.angular.bootstrap(el, [
|
|
30
32
|
"defaultModule",
|
|
31
33
|
(_$compileProvider_) => {
|
|
32
34
|
$compileProvider = _$compileProvider_;
|
|
@@ -223,80 +225,78 @@ describe("ngRepeat", () => {
|
|
|
223
225
|
expect(element.textContent.trim()).toEqual("");
|
|
224
226
|
});
|
|
225
227
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
scope,
|
|
241
|
-
);
|
|
242
|
-
await wait();
|
|
243
|
-
expect(scope[name][0].name).toEqual("blue");
|
|
244
|
-
expect(scope[name][1].name).toEqual("black");
|
|
245
|
-
expect(scope[name][2].name).toEqual("blonde");
|
|
246
|
-
dealoc(element);
|
|
247
|
-
},
|
|
248
|
-
);
|
|
228
|
+
for (const name of ["null2", "qthis", "qthisq", "fundefined", "$$parent"]) {
|
|
229
|
+
it(`should support alias identifier containing reserved word: ${name}`, async () => {
|
|
230
|
+
scope.x = "bl";
|
|
231
|
+
scope.items = [
|
|
232
|
+
{ name: "red" },
|
|
233
|
+
{ name: "blue" },
|
|
234
|
+
{ name: "green" },
|
|
235
|
+
{ name: "black" },
|
|
236
|
+
{ name: "orange" },
|
|
237
|
+
{ name: "blonde" },
|
|
238
|
+
];
|
|
239
|
+
|
|
240
|
+
const expr = `item in items | filter:x as ${name}`;
|
|
241
|
+
element = $compile(`<div><div ng-repeat="${expr}"></div></div>`)(scope);
|
|
249
242
|
|
|
250
|
-
|
|
251
|
-
});
|
|
243
|
+
await wait();
|
|
252
244
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
245
|
+
expect(scope[name][0].name).toEqual("blue");
|
|
246
|
+
expect(scope[name][1].name).toEqual("black");
|
|
247
|
+
expect(scope[name][2].name).toEqual("blonde");
|
|
248
|
+
|
|
249
|
+
dealoc(element);
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
for (const expr of [
|
|
254
|
+
"null",
|
|
255
|
+
"this",
|
|
256
|
+
"undefined",
|
|
257
|
+
"$parent",
|
|
258
|
+
"$root",
|
|
259
|
+
"$id",
|
|
260
|
+
"$index",
|
|
261
|
+
"$first",
|
|
262
|
+
"$middle",
|
|
263
|
+
"$last",
|
|
264
|
+
"$even",
|
|
265
|
+
"$odd",
|
|
266
|
+
"obj[key]",
|
|
267
|
+
'obj["key"]',
|
|
268
|
+
"obj['key']",
|
|
269
|
+
"obj.property",
|
|
270
|
+
"foo=6",
|
|
271
|
+
]) {
|
|
272
|
+
it(`should throw if alias identifier is not simple: ${expr}`, async () => {
|
|
273
|
+
scope.x = "bl";
|
|
274
|
+
scope.items = [
|
|
275
|
+
{ name: "red" },
|
|
276
|
+
{ name: "blue" },
|
|
277
|
+
{ name: "green" },
|
|
278
|
+
{ name: "black" },
|
|
279
|
+
{ name: "orange" },
|
|
280
|
+
{ name: "blonde" },
|
|
281
|
+
];
|
|
263
282
|
|
|
264
|
-
[
|
|
265
|
-
"null",
|
|
266
|
-
"this",
|
|
267
|
-
"undefined",
|
|
268
|
-
"$parent",
|
|
269
|
-
"$root",
|
|
270
|
-
"$id",
|
|
271
|
-
"$index",
|
|
272
|
-
"$first",
|
|
273
|
-
"$middle",
|
|
274
|
-
"$last",
|
|
275
|
-
"$even",
|
|
276
|
-
"$odd",
|
|
277
|
-
"obj[key]",
|
|
278
|
-
'obj["key"]',
|
|
279
|
-
"obj['key']",
|
|
280
|
-
"obj.property",
|
|
281
|
-
"foo=6",
|
|
282
|
-
].forEach(async (expr) => {
|
|
283
283
|
const expression = `item in items | filter:x as ${expr}`.replace(
|
|
284
284
|
/"/g,
|
|
285
285
|
""",
|
|
286
286
|
);
|
|
287
287
|
element = $compile(
|
|
288
|
-
`<div
|
|
289
|
-
|
|
290
|
-
|
|
288
|
+
`<div>
|
|
289
|
+
<div ng-repeat="${expression}">{{item}}</div>
|
|
290
|
+
</div>`,
|
|
291
291
|
)(scope);
|
|
292
|
+
|
|
292
293
|
await wait();
|
|
294
|
+
|
|
293
295
|
expect(logs.shift().message).toMatch(/must be a valid JS identifier/);
|
|
294
296
|
|
|
295
297
|
dealoc(element);
|
|
296
298
|
});
|
|
297
|
-
|
|
298
|
-
expect().toBe();
|
|
299
|
-
});
|
|
299
|
+
}
|
|
300
300
|
|
|
301
301
|
it("should allow expressions over multiple lines", async () => {
|
|
302
302
|
element = $compile(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { test, expect } from "@playwright/test";
|
|
2
2
|
|
|
3
|
-
const TEST_URL = "src/directive/repeat/repeat.html";
|
|
3
|
+
const TEST_URL = "src/directive/repeat/repeat.html?random=false";
|
|
4
4
|
|
|
5
5
|
test("unit tests contain no errors", async ({ page }) => {
|
|
6
6
|
await page.goto(TEST_URL);
|
|
7
7
|
await page.content();
|
|
8
8
|
await page.waitForTimeout(1000);
|
|
9
9
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
-
/0 failures/,
|
|
10
|
+
/ 0 failures/,
|
|
11
11
|
);
|
|
12
12
|
});
|
package/src/interface.ts
CHANGED
|
@@ -38,14 +38,15 @@ export type ExpandoStore = {
|
|
|
38
38
|
*/
|
|
39
39
|
export type AnnotatedFactory = [...string[], (...args: any[]) => any];
|
|
40
40
|
export type InjectableFactory = (...args: any[]) => any;
|
|
41
|
+
export type InjectableClass = new (...args: any[]) => any;
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
|
-
* A factory that can be either a standalone function or a dependency-annotated array.
|
|
44
|
+
* A factory that can be either a standalone function or a dependency-annotated array or a class (constructor function).
|
|
44
45
|
*
|
|
45
46
|
* The array form is used to support minification-safe dependency injection.
|
|
46
47
|
* See {@link AnnotatedFactory}.
|
|
47
48
|
*/
|
|
48
|
-
export type Injectable = AnnotatedFactory | InjectableFactory;
|
|
49
|
+
export type Injectable = AnnotatedFactory | InjectableFactory | InjectableClass;
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* An object that defines how a service is constructed.
|
|
@@ -2,7 +2,7 @@ import { createElementFromHTML, dealoc } from "../../shared/dom.js";
|
|
|
2
2
|
import { Angular } from "../../angular.js";
|
|
3
3
|
import { wait } from "../../shared/test-utils.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
fdescribe("ngView", () => {
|
|
6
6
|
window.location.hash = "";
|
|
7
7
|
let $stateProvider,
|
|
8
8
|
scope,
|
|
@@ -799,7 +799,7 @@ describe("ngView", () => {
|
|
|
799
799
|
// });
|
|
800
800
|
});
|
|
801
801
|
|
|
802
|
-
|
|
802
|
+
fdescribe("ngView named", () => {
|
|
803
803
|
let $stateProvider,
|
|
804
804
|
scope,
|
|
805
805
|
$compile,
|
|
@@ -812,6 +812,7 @@ describe("ngView named", () => {
|
|
|
812
812
|
$viewScroll;
|
|
813
813
|
|
|
814
814
|
beforeEach(() => {
|
|
815
|
+
dealoc(document.getElementById("app"));
|
|
815
816
|
window.angular = new Angular();
|
|
816
817
|
log = "";
|
|
817
818
|
app = window.angular
|
|
@@ -872,7 +873,7 @@ describe("ngView named", () => {
|
|
|
872
873
|
});
|
|
873
874
|
});
|
|
874
875
|
|
|
875
|
-
|
|
876
|
+
fdescribe("ngView transclusion", () => {
|
|
876
877
|
let scope, $compile, elem, $injector, $rootScope, $state;
|
|
877
878
|
|
|
878
879
|
beforeEach(() => {
|
|
@@ -928,7 +929,7 @@ describe("ngView transclusion", () => {
|
|
|
928
929
|
});
|
|
929
930
|
});
|
|
930
931
|
|
|
931
|
-
|
|
932
|
+
fdescribe("ngView controllers or onEnter handlers", () => {
|
|
932
933
|
let el, template, scope, count, $rootScope, $compile, $state, elem;
|
|
933
934
|
|
|
934
935
|
beforeEach(() => {
|
|
@@ -936,8 +937,9 @@ describe("ngView controllers or onEnter handlers", () => {
|
|
|
936
937
|
window.angular = new Angular();
|
|
937
938
|
window.angular
|
|
938
939
|
.module("defaultModule", [])
|
|
939
|
-
.config(function ($stateProvider) {
|
|
940
|
+
.config(function ($locationProvider, $stateProvider) {
|
|
940
941
|
count = 0;
|
|
942
|
+
$locationProvider.html5ModeConf.enabled = false;
|
|
941
943
|
$stateProvider
|
|
942
944
|
.state({
|
|
943
945
|
name: "aside",
|
|
@@ -1004,7 +1006,7 @@ describe("ngView controllers or onEnter handlers", () => {
|
|
|
1004
1006
|
});
|
|
1005
1007
|
});
|
|
1006
1008
|
|
|
1007
|
-
|
|
1009
|
+
fdescribe("angular 1.5+ style .component()", () => {
|
|
1008
1010
|
let el = document.getElementById("app"),
|
|
1009
1011
|
app,
|
|
1010
1012
|
scope,
|
|
@@ -1015,6 +1017,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1015
1017
|
$rootScope;
|
|
1016
1018
|
|
|
1017
1019
|
beforeEach(() => {
|
|
1020
|
+
dealoc(document.getElementById("app"));
|
|
1018
1021
|
window.angular = new Angular();
|
|
1019
1022
|
window.angular
|
|
1020
1023
|
.module("defaultModule", [])
|
|
@@ -48,12 +48,9 @@ describe("templateFactory", () => {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
it("rejects untrusted URLs", async () => {
|
|
51
|
-
let error = "No error thrown";
|
|
52
51
|
try {
|
|
53
52
|
await $templateFactory.fromUrl("http://evil.com/views/view.html");
|
|
54
|
-
} catch (e) {
|
|
55
|
-
error = e;
|
|
56
|
-
}
|
|
53
|
+
} catch (e) {}
|
|
57
54
|
expect(error).toMatch(/sce:insecurl/);
|
|
58
55
|
});
|
|
59
56
|
|