@angular-wave/angular.ts 0.0.63 → 0.0.65
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 +6 -2
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/public/jasmine/jasmine-5.1.2/jasmine-html.js +0 -1
- package/src/angular.spec.js +14 -19
- package/src/animations/module.js +2 -2
- package/src/binding.spec.js +7 -4
- package/src/core/animate/animate.spec.js +2 -4
- package/src/core/cache/cache-factory.spec.js +3 -3
- package/src/core/compile/compile.spec.js +66 -60
- package/src/core/controller/controller.spec.js +3 -3
- package/src/core/cookie-reader.spec.js +3 -3
- package/src/core/di/injector.html +18 -0
- package/src/{injector.js → core/di/injector.js} +58 -45
- package/src/{injector.spec.js → core/di/injector.spec.js} +44 -34
- package/src/core/di/injector.test.js +12 -0
- package/src/core/di/ng-module.html +18 -0
- package/src/core/di/ng-module.js +202 -0
- package/src/core/di/ng-module.spec.js +269 -0
- package/src/core/di/ng-module.test.js +12 -0
- package/src/core/filter/filter.spec.js +5 -5
- package/src/core/interpolate/interpolate.spec.js +3 -3
- package/src/core/interval/interval.spec.js +11 -8
- package/src/core/location/location.spec.js +3 -3
- package/src/core/on.spec.js +3 -3
- package/src/core/parser/lexer.spec.js +12 -9
- package/src/core/parser/parse.spec.js +12 -9
- package/src/core/prop.spec.js +48 -36
- package/src/core/q/q.spec.js +7 -10
- package/src/core/q/q.test.js +12 -0
- package/src/core/root-element.spec.js +0 -2
- package/src/core/sce/sce.spec.js +8 -7
- package/src/core/scope/scope.js +0 -1
- package/src/core/scope/scope.spec.js +12 -9
- package/src/core/timeout/timeout.spec.js +11 -8
- package/src/directive/attrs/attrs.spec.js +6 -5
- package/src/directive/attrs/boolean.spec.js +3 -3
- package/src/directive/attrs/element-style.spec.js +5 -4
- package/src/directive/attrs/src.spec.js +9 -7
- package/src/directive/bind/bind.spec.js +12 -9
- package/src/directive/bind/bing-html.spec.js +3 -3
- package/src/directive/change/change.spec.js +3 -3
- package/src/directive/class/class.spec.js +3 -3
- package/src/directive/cloak/cloak.spec.js +3 -3
- package/src/directive/controller/controller.spec.js +3 -4
- package/src/directive/events/click.spec.js +4 -4
- package/src/directive/events/event.spec.js +16 -13
- package/src/directive/form/form.spec.js +12 -10
- package/src/directive/if/if.spec.js +2 -3
- package/src/directive/include/include.spec.js +12 -11
- package/src/directive/init/init.spec.js +3 -4
- package/src/directive/input/input.spec.js +11 -9
- package/src/directive/list/list.spec.js +4 -4
- package/src/directive/model/model.spec.js +12 -12
- package/src/directive/model-options/model-options.spec.js +12 -10
- package/src/directive/non-bindable/non-bindable.spec.js +12 -9
- package/src/directive/options/options.spec.js +11 -8
- package/src/directive/ref/href.spec.js +12 -9
- package/src/directive/ref/ref.spec.js +11 -8
- package/src/directive/repeat/repeat.spec.js +12 -11
- package/src/directive/script/script.spec.js +5 -4
- package/src/directive/select/select.spec.js +11 -8
- package/src/directive/show-hide/show-hide.spec.js +5 -4
- package/src/directive/style/style.spec.js +10 -7
- package/src/directive/switch/switch.spec.js +3 -3
- package/src/directive/validators/validators.spec.js +13 -10
- package/src/exts/aria/aria.js +2 -2
- package/src/exts/aria/aria.spec.js +3 -3
- package/src/exts/messages/messages.js +2 -2
- package/src/exts/messages/messages.spec.js +3 -3
- package/src/filters/filter.spec.js +5 -4
- package/src/filters/filters.spec.js +5 -4
- package/src/filters/limit-to.spec.js +5 -4
- package/src/filters/order-by.spec.js +8 -6
- package/src/index.js +2 -8
- package/src/loader.js +107 -539
- package/src/loader.md +142 -0
- package/src/loader.spec.js +8 -27
- package/src/public.js +113 -107
- package/src/public.spec.js +3 -5
- package/src/router/directives/state-directives.spec.js +0 -3
- package/src/router/directives/view-directive.spec.js +0 -6
- package/src/router/index.js +2 -2
- package/src/router/services.spec.js +0 -2
- package/src/router/state/state.spec.js +2 -4
- package/src/router/state-filter.spec.js +0 -2
- package/src/router/template-factory.spec.js +0 -2
- package/src/router/url/url-service.spec.js +0 -2
- package/src/router/view/view.spec.js +1 -2
- package/src/router/view-hook.spec.js +0 -2
- package/src/router/view-scroll.spec.js +0 -3
- package/src/services/http/http.spec.js +3 -3
- package/src/services/http/template-request.spec.js +4 -4
- package/src/services/http-backend/http-backend.spec.js +4 -3
- package/src/shared/jqlite/jqlite.js +0 -2
- package/src/shared/jqlite/jqlite.spec.js +4 -5
- package/src/shared/test-utils.js +1 -1
- package/src/shared/utils.js +10 -1
- package/src/src.html +0 -1
- package/types/animations/module.d.ts +1 -1
- package/types/core/di/injector.d.ts +12 -0
- package/types/core/di/ng-module.d.ts +79 -0
- package/types/exts/aria/aria.d.ts +1 -1
- package/types/exts/messages/messages.d.ts +1 -1
- package/types/index.d.ts +0 -3
- package/types/loader.d.ts +53 -179
- package/types/public.d.ts +6 -1
- package/types/router/index.d.ts +1 -1
- package/types/shared/test-utils.d.ts +3 -2
- package/types/shared/utils.d.ts +7 -1
- package/types/injector.d.ts +0 -12
- /package/src/{injector.md → core/di/injector.md} +0 -0
package/src/core/q/q.test.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const TEST_URL = "src/core/q/q.html";
|
|
4
|
+
|
|
5
|
+
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
+
await page.goto(TEST_URL);
|
|
7
|
+
await page.content();
|
|
8
|
+
await page.waitForTimeout(100);
|
|
9
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
+
/0 failures/,
|
|
11
|
+
);
|
|
12
|
+
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { JQLite, dealoc } from "../shared/jqlite/jqlite";
|
|
2
2
|
import { Angular } from "../loader";
|
|
3
|
-
import { publishExternalAPI } from "../public";
|
|
4
3
|
|
|
5
4
|
describe("$rootElement", () => {
|
|
6
5
|
let angular = new Angular();
|
|
7
|
-
publishExternalAPI();
|
|
8
6
|
|
|
9
7
|
it("should publish the bootstrap element into $rootElement", () => {
|
|
10
8
|
const element = JQLite("<div></div>");
|
package/src/core/sce/sce.spec.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createInjector } from "
|
|
1
|
+
import { createInjector } from "../di/injector";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Angular } from "../../loader";
|
|
4
4
|
import { adjustMatcher } from "./sce";
|
|
5
5
|
|
|
6
6
|
describe("SCE", () => {
|
|
@@ -10,9 +10,10 @@ describe("SCE", () => {
|
|
|
10
10
|
|
|
11
11
|
describe("when disabled", () => {
|
|
12
12
|
beforeEach(function () {
|
|
13
|
-
|
|
13
|
+
window.angular = new Angular();
|
|
14
|
+
window.angular.module("myModule", ["ng"]);
|
|
14
15
|
createInjector([
|
|
15
|
-
"
|
|
16
|
+
"myModule",
|
|
16
17
|
function ($sceProvider) {
|
|
17
18
|
$sceProvider.enabled(false);
|
|
18
19
|
},
|
|
@@ -34,7 +35,7 @@ describe("SCE", () => {
|
|
|
34
35
|
|
|
35
36
|
describe("when enabled", () => {
|
|
36
37
|
beforeEach(function () {
|
|
37
|
-
|
|
38
|
+
window.angular = new Angular();
|
|
38
39
|
createInjector([
|
|
39
40
|
"ng",
|
|
40
41
|
function ($sceProvider) {
|
|
@@ -145,7 +146,7 @@ describe("SCE", () => {
|
|
|
145
146
|
|
|
146
147
|
describe("replace $sceDelegate", () => {
|
|
147
148
|
it("should override the default $sce.trustAs/valueOf/etc.", () => {
|
|
148
|
-
|
|
149
|
+
window.angular = new Angular();
|
|
149
150
|
createInjector([
|
|
150
151
|
"ng",
|
|
151
152
|
function ($provide) {
|
|
@@ -175,7 +176,7 @@ describe("SCE", () => {
|
|
|
175
176
|
});
|
|
176
177
|
|
|
177
178
|
describe("$sce.parseAs", () => {
|
|
178
|
-
|
|
179
|
+
window.angular = new Angular();
|
|
179
180
|
beforeEach(function () {
|
|
180
181
|
createInjector(["ng"]).invoke((_$sce_, _$rootScope_) => {
|
|
181
182
|
$sce = _$sce_;
|
package/src/core/scope/scope.js
CHANGED
|
@@ -1363,7 +1363,6 @@ export class Scope {
|
|
|
1363
1363
|
*/
|
|
1364
1364
|
decrementListenerCount(count, name) {
|
|
1365
1365
|
let self = this;
|
|
1366
|
-
// @ts-ignore
|
|
1367
1366
|
for (; self; self = self.$parent) {
|
|
1368
1367
|
if (self.$$listenerCount[name] !== undefined) {
|
|
1369
1368
|
self.$$listenerCount[name] -= count;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $$asyncQueue } from "./scope";
|
|
2
2
|
import { extend, sliceArgs } from "../../shared/utils";
|
|
3
|
-
import {
|
|
4
|
-
import { createInjector } from "
|
|
3
|
+
import { Angular } from "../../loader";
|
|
4
|
+
import { createInjector } from "../di/injector";
|
|
5
5
|
|
|
6
6
|
describe("Scope", function () {
|
|
7
7
|
let $rootScope;
|
|
@@ -12,14 +12,17 @@ describe("Scope", function () {
|
|
|
12
12
|
beforeEach(() => {
|
|
13
13
|
logs = [];
|
|
14
14
|
delete window.angular;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
window.angular = new Angular();
|
|
16
|
+
window.angular
|
|
17
|
+
.module("myModule", ["ng"])
|
|
18
|
+
.decorator("$exceptionHandler", function () {
|
|
19
|
+
return (exception, cause) => {
|
|
20
|
+
logs.push(exception);
|
|
21
|
+
console.error(exception, cause);
|
|
22
|
+
};
|
|
23
|
+
});
|
|
21
24
|
|
|
22
|
-
let injector = createInjector(["
|
|
25
|
+
let injector = createInjector(["myModule"]);
|
|
23
26
|
$parse = injector.get("$parse");
|
|
24
27
|
$browser = injector.get("$browser");
|
|
25
28
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createInjector } from "
|
|
1
|
+
import { Angular } from "../../loader";
|
|
2
|
+
import { createInjector } from "../di/injector";
|
|
3
3
|
import { wait } from "../../shared/test-utils";
|
|
4
4
|
|
|
5
5
|
describe("$timeout", () => {
|
|
@@ -14,12 +14,15 @@ describe("$timeout", () => {
|
|
|
14
14
|
beforeEach(() => {
|
|
15
15
|
errors = [];
|
|
16
16
|
log = [];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
window.angular = new Angular();
|
|
18
|
+
window.angular
|
|
19
|
+
.module("myModule", ["ng"])
|
|
20
|
+
.decorator("$exceptionHandler", function () {
|
|
21
|
+
return (exception) => {
|
|
22
|
+
errors.push(exception);
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
injector = createInjector(["myModule"]);
|
|
23
26
|
|
|
24
27
|
$interval = injector.get("$interval");
|
|
25
28
|
$rootScope = injector.get("$rootScope");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc
|
|
1
|
+
import { Angular } from "../../loader";
|
|
2
|
+
import { createInjector } from "../../core/di/injector";
|
|
3
|
+
import { dealoc } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("ngSrcset", () => {
|
|
6
6
|
let $scope;
|
|
@@ -8,8 +8,9 @@ describe("ngSrcset", () => {
|
|
|
8
8
|
let element;
|
|
9
9
|
|
|
10
10
|
beforeEach(() => {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
window.angular = new Angular();
|
|
12
|
+
window.angular.module("myModule", ["ng"]);
|
|
13
|
+
createInjector(["myModule"]).invoke(($rootScope, _$compile_) => {
|
|
13
14
|
$scope = $rootScope.$new();
|
|
14
15
|
$compile = _$compile_;
|
|
15
16
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createInjector } from "../../injector";
|
|
1
|
+
import { Angular } from "../../loader";
|
|
2
|
+
import { createInjector } from "../../core/di/injector";
|
|
3
3
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("boolean attr directives", () => {
|
|
6
6
|
let element, $rootScope, $compile, $rootElement;
|
|
7
7
|
|
|
8
8
|
beforeEach(() => {
|
|
9
|
-
|
|
9
|
+
window.angular = new Angular();
|
|
10
10
|
createInjector([
|
|
11
11
|
"ng",
|
|
12
12
|
($provide) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createInjector } from "../../injector";
|
|
1
|
+
import { Angular } from "../../loader";
|
|
2
|
+
import { createInjector } from "../../core/di/injector";
|
|
3
3
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("style", () => {
|
|
@@ -8,8 +8,9 @@ describe("style", () => {
|
|
|
8
8
|
let element;
|
|
9
9
|
|
|
10
10
|
beforeEach(() => {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
window.angular = new Angular();
|
|
12
|
+
window.angular.module("myModule", ["ng"]);
|
|
13
|
+
createInjector(["myModule"]).invoke((_$rootScope_, _$compile_) => {
|
|
13
14
|
$rootScope = _$rootScope_;
|
|
14
15
|
$compile = _$compile_;
|
|
15
16
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc
|
|
1
|
+
import { Angular } from "../../loader";
|
|
2
|
+
import { createInjector } from "../../core/di/injector";
|
|
3
|
+
import { dealoc } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("ngSrc", () => {
|
|
6
6
|
let $scope;
|
|
@@ -8,8 +8,9 @@ describe("ngSrc", () => {
|
|
|
8
8
|
let element;
|
|
9
9
|
|
|
10
10
|
beforeEach(() => {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
window.angular = new Angular();
|
|
12
|
+
window.angular.module("myModule", ["ng"]);
|
|
13
|
+
createInjector(["myModule"]).invoke(($rootScope, _$compile_) => {
|
|
13
14
|
$scope = $rootScope.$new();
|
|
14
15
|
$compile = _$compile_;
|
|
15
16
|
});
|
|
@@ -84,8 +85,9 @@ describe("ngSrc", () => {
|
|
|
84
85
|
let $sce;
|
|
85
86
|
|
|
86
87
|
beforeEach(() => {
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
window.angular = new Angular();
|
|
89
|
+
window.angular.module("myModule", ["ng"]);
|
|
90
|
+
createInjector(["myModule"]).invoke(($rootScope, _$compile_, _$sce_) => {
|
|
89
91
|
$scope = $rootScope.$new();
|
|
90
92
|
$compile = _$compile_;
|
|
91
93
|
$sce = _$sce_;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc
|
|
1
|
+
import { Angular } from "../../loader";
|
|
2
|
+
import { createInjector } from "../../core/di/injector";
|
|
3
|
+
import { dealoc } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("ng-bind", () => {
|
|
6
6
|
let $rootScope;
|
|
@@ -10,12 +10,15 @@ describe("ng-bind", () => {
|
|
|
10
10
|
let $sce;
|
|
11
11
|
|
|
12
12
|
beforeEach(() => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
window.angular = new Angular();
|
|
14
|
+
window.angular
|
|
15
|
+
.module("myModule", ["ng"])
|
|
16
|
+
.decorator("$exceptionHandler", function () {
|
|
17
|
+
return (exception, cause) => {
|
|
18
|
+
throw new Error(exception.message);
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
createInjector(["myModule"]).invoke((_$rootScope_, _$compile_, _$sce_) => {
|
|
19
22
|
$rootScope = _$rootScope_;
|
|
20
23
|
$compile = _$compile_;
|
|
21
24
|
$sce = _$sce_;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { createInjector } from "../../injector";
|
|
1
|
+
import { createInjector } from "../../core/di/injector";
|
|
2
2
|
import { forEach } from "../../shared/utils";
|
|
3
|
-
import {
|
|
3
|
+
import { Angular } from "../../loader";
|
|
4
4
|
|
|
5
5
|
describe("ngBindHtml", () => {
|
|
6
6
|
let $rootScope, $compile;
|
|
7
7
|
|
|
8
8
|
beforeEach(() => {
|
|
9
|
-
|
|
9
|
+
window.angular = new Angular();
|
|
10
10
|
createInjector(["ng"]).invoke((_$rootScope_, _$compile_) => {
|
|
11
11
|
$rootScope = _$rootScope_;
|
|
12
12
|
$compile = _$compile_;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { createInjector } from "../../injector";
|
|
1
|
+
import { createInjector } from "../../core/di/injector";
|
|
2
2
|
import { dealoc } from "../../shared/jqlite/jqlite";
|
|
3
|
-
import {
|
|
3
|
+
import { Angular } from "../../loader";
|
|
4
4
|
|
|
5
5
|
describe("ngChange", () => {
|
|
6
6
|
let injector;
|
|
7
7
|
let el;
|
|
8
8
|
|
|
9
9
|
beforeEach(() => {
|
|
10
|
-
|
|
10
|
+
window.angular = new Angular();
|
|
11
11
|
injector = createInjector(["ng"]);
|
|
12
12
|
});
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
2
|
-
import {
|
|
3
|
-
import { createInjector } from "../../injector";
|
|
2
|
+
import { Angular } from "../../loader";
|
|
3
|
+
import { createInjector } from "../../core/di/injector";
|
|
4
4
|
import { valueFn } from "../../shared/utils";
|
|
5
5
|
|
|
6
6
|
describe("ngClass", () => {
|
|
@@ -10,7 +10,7 @@ describe("ngClass", () => {
|
|
|
10
10
|
let injector;
|
|
11
11
|
|
|
12
12
|
beforeEach(() => {
|
|
13
|
-
|
|
13
|
+
window.angular = new Angular();
|
|
14
14
|
injector = createInjector(["ng"]);
|
|
15
15
|
$compile = injector.get("$compile");
|
|
16
16
|
$rootScope = injector.get("$rootScope");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
2
|
-
import {
|
|
3
|
-
import { createInjector } from "../../injector";
|
|
2
|
+
import { Angular } from "../../loader";
|
|
3
|
+
import { createInjector } from "../../core/di/injector";
|
|
4
4
|
|
|
5
5
|
describe("ngCloak", () => {
|
|
6
6
|
let element;
|
|
@@ -9,7 +9,7 @@ describe("ngCloak", () => {
|
|
|
9
9
|
let injector;
|
|
10
10
|
|
|
11
11
|
beforeEach(() => {
|
|
12
|
-
|
|
12
|
+
window.angular = new Angular();
|
|
13
13
|
injector = createInjector(["ng"]);
|
|
14
14
|
$compile = injector.get("$compile");
|
|
15
15
|
$rootScope = injector.get("$rootScope");
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createInjector } from "../../injector";
|
|
1
|
+
import { Angular } from "../../loader";
|
|
2
|
+
import { createInjector } from "../../core/di/injector";
|
|
3
3
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
import { bind } from "../../shared/utils";
|
|
5
|
-
import { Angular } from "../../loader";
|
|
6
5
|
|
|
7
6
|
describe("ngController", () => {
|
|
8
7
|
let angular;
|
|
@@ -34,7 +33,7 @@ describe("ngController", () => {
|
|
|
34
33
|
|
|
35
34
|
beforeEach(() => {
|
|
36
35
|
angular = new Angular();
|
|
37
|
-
|
|
36
|
+
window.angular = new Angular();
|
|
38
37
|
injector = createInjector([
|
|
39
38
|
"ng",
|
|
40
39
|
($controllerProvider) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { dealoc
|
|
2
|
-
import {
|
|
3
|
-
import { createInjector } from "../../injector";
|
|
1
|
+
import { dealoc } from "../../shared/jqlite/jqlite";
|
|
2
|
+
import { Angular } from "../../loader";
|
|
3
|
+
import { createInjector } from "../../core/di/injector";
|
|
4
4
|
|
|
5
5
|
describe("ngClick", () => {
|
|
6
6
|
let element;
|
|
@@ -9,7 +9,7 @@ describe("ngClick", () => {
|
|
|
9
9
|
let injector;
|
|
10
10
|
|
|
11
11
|
beforeEach(() => {
|
|
12
|
-
|
|
12
|
+
window.angular = new Angular();
|
|
13
13
|
injector = createInjector(["ng"]);
|
|
14
14
|
$compile = injector.get("$compile");
|
|
15
15
|
$rootScope = injector.get("$rootScope");
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { publishExternalAPI } from "../../public";
|
|
2
|
-
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
1
|
import { Angular } from "../../loader";
|
|
2
|
+
import { createInjector } from "../../core/di/injector";
|
|
3
|
+
import { dealoc } from "../../shared/jqlite/jqlite";
|
|
5
4
|
|
|
6
5
|
describe("event directives", () => {
|
|
7
6
|
let angular;
|
|
@@ -12,16 +11,20 @@ describe("event directives", () => {
|
|
|
12
11
|
let logs = [];
|
|
13
12
|
|
|
14
13
|
beforeEach(() => {
|
|
15
|
-
angular = new Angular();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
angular = window.angular = new Angular();
|
|
15
|
+
window.angular
|
|
16
|
+
.module("myModule", ["ng"])
|
|
17
|
+
.decorator("$exceptionHandler", function () {
|
|
18
|
+
return (exception, cause) => {
|
|
19
|
+
logs.push(exception.message);
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
injector = createInjector(["myModule"]).invoke(
|
|
23
|
+
(_$rootScope_, _$compile_) => {
|
|
24
|
+
$rootScope = _$rootScope_;
|
|
25
|
+
$compile = _$compile_;
|
|
26
|
+
},
|
|
27
|
+
);
|
|
25
28
|
});
|
|
26
29
|
|
|
27
30
|
afterEach(() => {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createInjector } from "../../injector";
|
|
1
|
+
import { Angular } from "../../loader";
|
|
2
|
+
import { createInjector } from "../../core/di/injector";
|
|
3
3
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
import { FormController } from "../../directive/form/form";
|
|
5
|
-
import { Angular } from "../../loader";
|
|
6
5
|
|
|
7
6
|
describe("form", () => {
|
|
8
7
|
let doc;
|
|
@@ -12,13 +11,16 @@ describe("form", () => {
|
|
|
12
11
|
let injector;
|
|
13
12
|
|
|
14
13
|
beforeEach(() => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
window.angular = new Angular();
|
|
15
|
+
window.angular
|
|
16
|
+
.module("myModule", ["ng"])
|
|
17
|
+
.decorator("$exceptionHandler", function () {
|
|
18
|
+
return (exception, cause) => {
|
|
19
|
+
throw new Error(exception);
|
|
20
|
+
};
|
|
21
|
+
});
|
|
20
22
|
injector = createInjector([
|
|
21
|
-
"
|
|
23
|
+
"myModule",
|
|
22
24
|
($compileProvider) => {
|
|
23
25
|
$compileProvider.directive("storeModelCtrl", () => ({
|
|
24
26
|
require: "ngModel",
|
|
@@ -1407,7 +1409,7 @@ describe("form", () => {
|
|
|
1407
1409
|
doc = JQLite('<form name="myForm"></form>');
|
|
1408
1410
|
JQLite(dummy).append(doc);
|
|
1409
1411
|
let angular = new Angular();
|
|
1410
|
-
|
|
1412
|
+
window.angular = new Angular();
|
|
1411
1413
|
myModule = window.angular.module("myModule", ["ngAnimate"]);
|
|
1412
1414
|
|
|
1413
1415
|
injector = angular.bootstrap(dummy, ["myModule"]);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
2
2
|
import { forEach, valueFn } from "../../shared/utils";
|
|
3
|
-
import { publishExternalAPI } from "../../public";
|
|
4
|
-
import { createInjector } from "../../injector";
|
|
5
3
|
import { Angular } from "../../loader";
|
|
4
|
+
import { createInjector } from "../../core/di/injector";
|
|
6
5
|
import { wait } from "../../shared/test-utils";
|
|
7
6
|
|
|
8
7
|
describe("ngIf", () => {
|
|
@@ -17,7 +16,7 @@ describe("ngIf", () => {
|
|
|
17
16
|
|
|
18
17
|
beforeEach(function () {
|
|
19
18
|
angular = new Angular();
|
|
20
|
-
|
|
19
|
+
window.angular = new Angular();
|
|
21
20
|
injector = createInjector([
|
|
22
21
|
"ng",
|
|
23
22
|
function (_$compileProvider_) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
2
2
|
import { Angular } from "../../loader";
|
|
3
|
-
import { createInjector } from "../../injector";
|
|
4
|
-
import { publishExternalAPI } from "../../public";
|
|
3
|
+
import { createInjector } from "../../core/di/injector";
|
|
5
4
|
import { valueFn } from "../../shared/utils";
|
|
6
5
|
import { wait } from "../../shared/test-utils";
|
|
7
6
|
|
|
@@ -17,14 +16,16 @@ describe("ngInclude", () => {
|
|
|
17
16
|
|
|
18
17
|
beforeEach(() => {
|
|
19
18
|
delete window.angular;
|
|
20
|
-
angular = new Angular();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
angular = window.angular = new Angular();
|
|
20
|
+
module = angular
|
|
21
|
+
.module("myModule", ["ng"])
|
|
22
|
+
.decorator("$exceptionHandler", function () {
|
|
23
|
+
return (exception, cause) => {
|
|
24
|
+
throw new Error(exception.message);
|
|
25
|
+
};
|
|
26
|
+
});
|
|
26
27
|
// module = window.angular.module("myModule", []);
|
|
27
|
-
injector = createInjector(["
|
|
28
|
+
injector = createInjector(["myModule"]);
|
|
28
29
|
$rootScope = injector.get("$rootScope");
|
|
29
30
|
$templateCache = injector.get("$templateCache");
|
|
30
31
|
$compile = injector.get("$compile");
|
|
@@ -94,7 +95,7 @@ describe("ngInclude", () => {
|
|
|
94
95
|
|
|
95
96
|
it("should NOT use untrusted URL expressions ", () => {
|
|
96
97
|
element = JQLite('<ng-include src="url"></ng-include>');
|
|
97
|
-
const injector = angular.bootstrap(element);
|
|
98
|
+
const injector = angular.bootstrap(element, ["myModule"]);
|
|
98
99
|
$rootScope = injector.get("$rootScope");
|
|
99
100
|
$rootScope.url = "http://example.com/myUrl";
|
|
100
101
|
expect(() => {
|
|
@@ -104,7 +105,7 @@ describe("ngInclude", () => {
|
|
|
104
105
|
|
|
105
106
|
it("should NOT use mistyped expressions ", () => {
|
|
106
107
|
element = JQLite('<ng-include src="url"></ng-include>');
|
|
107
|
-
const injector = angular.bootstrap(element);
|
|
108
|
+
const injector = angular.bootstrap(element, ["myModule"]);
|
|
108
109
|
$rootScope = injector.get("$rootScope");
|
|
109
110
|
$rootScope.name = "chirayu";
|
|
110
111
|
let $sce = injector.get("$sce");
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
2
|
-
import {
|
|
3
|
-
import { createInjector } from "../../injector";
|
|
4
|
-
import { Angular, setupModuleLoader } from "../../loader";
|
|
2
|
+
import { Angular } from "../../loader";
|
|
3
|
+
import { createInjector } from "../../core/di/injector";
|
|
5
4
|
|
|
6
5
|
describe("ngInit", () => {
|
|
7
6
|
let element;
|
|
@@ -13,7 +12,7 @@ describe("ngInit", () => {
|
|
|
13
12
|
|
|
14
13
|
beforeEach(() => {
|
|
15
14
|
angular = new Angular();
|
|
16
|
-
|
|
15
|
+
window.angular = new Angular();
|
|
17
16
|
injector = createInjector(["ng"]);
|
|
18
17
|
$rootScope = injector.get("$rootScope");
|
|
19
18
|
$compile = injector.get("$compile");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createInjector } from "../../injector";
|
|
1
|
+
import { Angular } from "../../loader";
|
|
2
|
+
import { createInjector } from "../../core/di/injector";
|
|
3
3
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
import { EMAIL_REGEXP, ISO_DATE_REGEXP, URL_REGEXP } from "./input";
|
|
5
5
|
import { forEach } from "../../shared/utils";
|
|
@@ -10,12 +10,15 @@ describe("input", () => {
|
|
|
10
10
|
let inputElm;
|
|
11
11
|
|
|
12
12
|
beforeEach(() => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
window.angular = new Angular();
|
|
14
|
+
window.angular
|
|
15
|
+
.module("myModule", ["ng"])
|
|
16
|
+
.decorator("$exceptionHandler", function () {
|
|
17
|
+
return (exception) => {
|
|
18
|
+
throw new Error(exception.message);
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
createInjector(["myModule"]).invoke((_$compile_, $rootScope) => {
|
|
19
22
|
$compile = _$compile_;
|
|
20
23
|
scope = $rootScope.$new();
|
|
21
24
|
});
|
|
@@ -3047,7 +3050,6 @@ describe("input", () => {
|
|
|
3047
3050
|
"a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
3048
3051
|
),
|
|
3049
3052
|
).toBe(false);
|
|
3050
|
-
/* eslint-disable max-len */
|
|
3051
3053
|
expect(
|
|
3052
3054
|
EMAIL_REGEXP.test(
|
|
3053
3055
|
"a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { dealoc
|
|
2
|
-
import {
|
|
3
|
-
import { createInjector } from "../../injector";
|
|
1
|
+
import { dealoc } from "../../shared/jqlite/jqlite";
|
|
2
|
+
import { Angular } from "../../loader";
|
|
3
|
+
import { createInjector } from "../../core/di/injector";
|
|
4
4
|
|
|
5
5
|
describe("ngList", () => {
|
|
6
6
|
let $rootScope;
|
|
@@ -10,7 +10,7 @@ describe("ngList", () => {
|
|
|
10
10
|
let inputElm;
|
|
11
11
|
|
|
12
12
|
beforeEach(() => {
|
|
13
|
-
|
|
13
|
+
window.angular = new Angular();
|
|
14
14
|
injector = createInjector(["ng"]);
|
|
15
15
|
$compile = injector.get("$compile");
|
|
16
16
|
$rootScope = injector.get("$rootScope");
|