@angular-wave/angular.ts 0.3.1 → 0.4.0
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/.github/workflows/ci.yml +57 -0
- package/README.md +1 -1
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/core/compile/attributes.js +1 -1
- package/src/core/compile/compile.js +1 -1
- package/src/core/compile/compile.test.js +1 -1
- package/src/core/exception-handler.js +1 -5
- package/src/core/interval/interval-factory.js +6 -22
- package/src/core/interval/interval.spec.js +0 -25
- package/src/core/q/q.js +0 -27
- package/src/core/q/q.spec.js +0 -44
- package/src/core/scope/scope.js +34 -40
- package/src/core/scope/scope.spec.js +71 -13
- package/src/core/timeout/timeout.js +2 -6
- package/src/directive/attrs/attrs.js +1 -1
- package/src/directive/input/input.spec.js +0 -1
- package/src/directive/observe/observe.html +18 -0
- package/src/directive/observe/observe.js +37 -0
- package/src/directive/observe/observe.spec.js +92 -0
- package/src/directive/observe/observe.test.js +9 -0
- package/src/directive/observe/test.html +197 -0
- package/src/public.js +7 -6
- package/src/router/state/state-service.js +3 -3
- package/src/router/view-scroll.js +13 -8
- package/src/services/log.js +0 -6
- package/types/core/compile/attributes.d.ts +3 -3
- package/types/core/compile/compile.d.ts +1 -1
- package/types/core/exception-handler.d.ts +2 -2
- package/types/core/interval/interval-factory.d.ts +1 -1
- package/types/core/q/q.d.ts +0 -5
- package/types/core/scope/scope.d.ts +11 -2
- package/types/core/timeout/timeout.d.ts +2 -2
- package/types/directive/observe/observe.d.ts +4 -0
- package/types/router/state/state-service.d.ts +1 -1
- package/types/router/view-scroll.d.ts +3 -3
- package/types/services/log.d.ts +0 -5
- package/.github/workflows/lint.yml +0 -19
- package/.github/workflows/playwright.yml +0 -27
- package/.github/workflows/types.yml +0 -19
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script type="module" src="/src/directive/observe/observe.spec.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="dummy"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @returns {import("../../types").Directive}
|
|
3
|
+
*/
|
|
4
|
+
export function ngObserveDirective() {
|
|
5
|
+
return {
|
|
6
|
+
restrict: "A",
|
|
7
|
+
link: (scope, element, attrs) => {
|
|
8
|
+
const targetElement = element[0];
|
|
9
|
+
const prop = targetElement.dataset["update"];
|
|
10
|
+
const source = attrs["ngObserve"];
|
|
11
|
+
|
|
12
|
+
if (!scope[prop]) {
|
|
13
|
+
scope[prop] = targetElement.getAttribute(source);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const observer = new MutationObserver((mutations) => {
|
|
17
|
+
const mutation = mutations[0];
|
|
18
|
+
const newValue = /** @type {HTMLElement} */ (
|
|
19
|
+
mutation.target
|
|
20
|
+
).getAttribute(source);
|
|
21
|
+
if (scope[prop] !== newValue) {
|
|
22
|
+
scope[prop] = newValue;
|
|
23
|
+
scope.$digest();
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
observer.observe(targetElement, {
|
|
28
|
+
attributes: true,
|
|
29
|
+
attributeFilter: [source],
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
scope.$on("$destroy", () => {
|
|
33
|
+
observer.disconnect();
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Angular } from "../../loader";
|
|
2
|
+
import { JQLite } from "../../shared/jqlite/jqlite";
|
|
3
|
+
|
|
4
|
+
describe("observe", () => {
|
|
5
|
+
let $compile, $scope, $rootScope, element, observerSpy;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
window.angular = new Angular();
|
|
9
|
+
angular.module("myModule", ["ng"]);
|
|
10
|
+
angular
|
|
11
|
+
.bootstrap(document.getElementById("dummy"), ["myModule"])
|
|
12
|
+
.invoke((_$compile_, _$rootScope_) => {
|
|
13
|
+
$compile = _$compile_;
|
|
14
|
+
$rootScope = _$rootScope_;
|
|
15
|
+
$scope = $rootScope.$new();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
observerSpy = jasmine.createSpyObj("MutationObserver", [
|
|
19
|
+
"observe",
|
|
20
|
+
"disconnect",
|
|
21
|
+
]);
|
|
22
|
+
spyOn(window, "MutationObserver").and.returnValue(observerSpy); // Replace with a spy
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
function createDirective(attributeValue, updateProp) {
|
|
26
|
+
const template = `<div ng-observe="${attributeValue}" data-update="${updateProp}"></div>`;
|
|
27
|
+
element = $compile(template)($scope);
|
|
28
|
+
$scope.$digest();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
it("should set the scope property to the attribute value before any changes", () => {
|
|
32
|
+
const scope = $rootScope.$new();
|
|
33
|
+
const element = JQLite(
|
|
34
|
+
'<div data-update="testProp" ng-observe="sourceAttr"></div>',
|
|
35
|
+
);
|
|
36
|
+
element.attr("sourceAttr", "initialValue");
|
|
37
|
+
$compile(element)(scope);
|
|
38
|
+
|
|
39
|
+
expect(scope.testProp).toBeDefined();
|
|
40
|
+
expect(scope.testProp).toEqual("initialValue");
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("should observe attribute changes and update the scope property", () => {
|
|
44
|
+
$scope.myProp = "";
|
|
45
|
+
createDirective("test-attribute", "myProp");
|
|
46
|
+
spyOn($scope, "$digest").and.callThrough();
|
|
47
|
+
|
|
48
|
+
const mutationObserverCallback =
|
|
49
|
+
MutationObserver.calls.mostRecent().args[0];
|
|
50
|
+
const mutationRecord = {
|
|
51
|
+
target: element[0],
|
|
52
|
+
attributeName: "test-attribute",
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
element.attr("test-attribute", "newValue");
|
|
56
|
+
element[0].setAttribute("test-attribute", "newValue");
|
|
57
|
+
|
|
58
|
+
mutationObserverCallback([mutationRecord]);
|
|
59
|
+
|
|
60
|
+
expect($scope.myProp).toBe("newValue");
|
|
61
|
+
expect($scope.$digest).toHaveBeenCalled();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("should not trigger digest cycle if the attribute value is unchanged", () => {
|
|
65
|
+
$scope.myProp = "existingValue";
|
|
66
|
+
createDirective("test-attribute", "myProp");
|
|
67
|
+
|
|
68
|
+
spyOn($scope, "$digest").and.callThrough();
|
|
69
|
+
|
|
70
|
+
const mutationObserverCallback =
|
|
71
|
+
MutationObserver.calls.mostRecent().args[0];
|
|
72
|
+
const mutationRecord = {
|
|
73
|
+
target: element[0],
|
|
74
|
+
attributeName: "test-attribute",
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
element.attr("test-attribute", "existingValue");
|
|
78
|
+
element[0].setAttribute("test-attribute", "existingValue");
|
|
79
|
+
|
|
80
|
+
mutationObserverCallback([mutationRecord]);
|
|
81
|
+
|
|
82
|
+
expect($scope.$digest).not.toHaveBeenCalled();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("should disconnect the observer on scope destruction", () => {
|
|
86
|
+
createDirective("test-attribute", "myProp");
|
|
87
|
+
|
|
88
|
+
$scope.$destroy();
|
|
89
|
+
|
|
90
|
+
expect(observerSpy.disconnect).toHaveBeenCalled();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
test("unit observer tests contain no errors", async ({ page }) => {
|
|
4
|
+
await page.goto("src/directive/observe/observe.html");
|
|
5
|
+
await page.content();
|
|
6
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
7
|
+
/0 failures/,
|
|
8
|
+
);
|
|
9
|
+
});
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<script type="module" src="/src/index.js"></script>
|
|
9
|
+
<link
|
|
10
|
+
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
|
|
11
|
+
rel="stylesheet"
|
|
12
|
+
/>
|
|
13
|
+
<script>
|
|
14
|
+
// Define a custom web component called <test-component>
|
|
15
|
+
class TestComponent extends HTMLElement {
|
|
16
|
+
// Called when the element is added to the DOM
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
// Get the value of the 'greeting' attribute
|
|
19
|
+
const greeting = this.getAttribute("greeting") || "world";
|
|
20
|
+
|
|
21
|
+
// Set the inner HTML to display the greeting
|
|
22
|
+
this.innerHTML = `<p>Hello ${greeting}</p>`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Define which attributes to observe
|
|
26
|
+
static get observedAttributes() {
|
|
27
|
+
return ["greeting"];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Called when an observed attribute changes
|
|
31
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
32
|
+
if (name === "greeting") {
|
|
33
|
+
this.innerHTML = `<p>Hello ${newValue}</p>`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Register the custom element
|
|
39
|
+
customElements.define("test-component", TestComponent);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
44
|
+
var app = window.angular.module("myApp", []);
|
|
45
|
+
});
|
|
46
|
+
</script>
|
|
47
|
+
<script type="module">
|
|
48
|
+
import {
|
|
49
|
+
fluentSelect,
|
|
50
|
+
fluentOption,
|
|
51
|
+
fluentTab,
|
|
52
|
+
fluentTabPanel,
|
|
53
|
+
fluentTabs,
|
|
54
|
+
provideFluentDesignSystem,
|
|
55
|
+
fluentRadio,
|
|
56
|
+
fluentRadioGroup,
|
|
57
|
+
fluentSwitch,
|
|
58
|
+
} from "https://unpkg.com/@fluentui/web-components@2.0.0";
|
|
59
|
+
provideFluentDesignSystem().register(
|
|
60
|
+
fluentSelect(),
|
|
61
|
+
fluentTab(),
|
|
62
|
+
fluentTabPanel(),
|
|
63
|
+
fluentTabs(),
|
|
64
|
+
fluentRadio(),
|
|
65
|
+
fluentRadioGroup(),
|
|
66
|
+
fluentSwitch(),
|
|
67
|
+
);
|
|
68
|
+
</script>
|
|
69
|
+
</head>
|
|
70
|
+
<body ng-app="myApp">
|
|
71
|
+
<div id="dummy">{{ greeting }}</div>
|
|
72
|
+
<input ng-model="greeting" />
|
|
73
|
+
|
|
74
|
+
<test-component greeting="{{ greeting }}"></test-component>
|
|
75
|
+
<div>{{ greeting }}</div>
|
|
76
|
+
|
|
77
|
+
<fluent-select
|
|
78
|
+
ng-observe="current-value"
|
|
79
|
+
data-update="greeting"
|
|
80
|
+
title="Select a section"
|
|
81
|
+
>
|
|
82
|
+
<fluent-option value="Beginning">Beginning</fluent-option>
|
|
83
|
+
<fluent-option value="Middle">Middle</fluent-option>
|
|
84
|
+
<fluent-option value="End">End</fluent-option>
|
|
85
|
+
</fluent-select>
|
|
86
|
+
<br />
|
|
87
|
+
|
|
88
|
+
{{ activeid }}
|
|
89
|
+
<fluent-tabs
|
|
90
|
+
ng-observe="activeid"
|
|
91
|
+
data-update="activeid"
|
|
92
|
+
activeid="entrees"
|
|
93
|
+
>
|
|
94
|
+
<fluent-tab id="apps">Appetizers</fluent-tab>
|
|
95
|
+
<fluent-tab id="entrees">Entrees</fluent-tab>
|
|
96
|
+
<fluent-tab id="desserts">Desserts</fluent-tab>
|
|
97
|
+
<fluent-tab-panel id="appsPanel">
|
|
98
|
+
<ol>
|
|
99
|
+
<li>
|
|
100
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
101
|
+
>Stuffed artichokes</fluent-anchor
|
|
102
|
+
>
|
|
103
|
+
</li>
|
|
104
|
+
<li>
|
|
105
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
106
|
+
>Bruschetta</fluent-anchor
|
|
107
|
+
>
|
|
108
|
+
</li>
|
|
109
|
+
<li>
|
|
110
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
111
|
+
>Oven-baked polenta</fluent-anchor
|
|
112
|
+
>
|
|
113
|
+
</li>
|
|
114
|
+
<li>
|
|
115
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
116
|
+
>Salami and Fig Crostini with Ricotta</fluent-anchor
|
|
117
|
+
>
|
|
118
|
+
</li>
|
|
119
|
+
<li>
|
|
120
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
121
|
+
>Rosemary-Potato Focaccia with Goat Cheese</fluent-anchor
|
|
122
|
+
>
|
|
123
|
+
</li>
|
|
124
|
+
</ol>
|
|
125
|
+
</fluent-tab-panel>
|
|
126
|
+
<fluent-tab-panel id="entreesPanel">
|
|
127
|
+
<ol>
|
|
128
|
+
<li>
|
|
129
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
130
|
+
>Mushroom-Sausage Ragù</fluent-anchor
|
|
131
|
+
>
|
|
132
|
+
</li>
|
|
133
|
+
<li>
|
|
134
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
135
|
+
>Tomato Bread Soup with Steamed Mussels</fluent-anchor
|
|
136
|
+
>
|
|
137
|
+
</li>
|
|
138
|
+
<li>
|
|
139
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
140
|
+
>Grilled Fish with Artichoke Caponata</fluent-anchor
|
|
141
|
+
>
|
|
142
|
+
</li>
|
|
143
|
+
<li>
|
|
144
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
145
|
+
>Celery Root and Mushroom Lasagna</fluent-anchor
|
|
146
|
+
>
|
|
147
|
+
</li>
|
|
148
|
+
<li>
|
|
149
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
150
|
+
>Osso Buco with Citrus Gremolata</fluent-anchor
|
|
151
|
+
>
|
|
152
|
+
</li>
|
|
153
|
+
</ol>
|
|
154
|
+
</fluent-tab-panel>
|
|
155
|
+
<fluent-tab-panel id="dessertsPanel">
|
|
156
|
+
<ol>
|
|
157
|
+
<li>
|
|
158
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
159
|
+
>Tiramisu</fluent-anchor
|
|
160
|
+
>
|
|
161
|
+
</li>
|
|
162
|
+
<li>
|
|
163
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
164
|
+
>Spumoni</fluent-anchor
|
|
165
|
+
>
|
|
166
|
+
</li>
|
|
167
|
+
<li>
|
|
168
|
+
<fluent-anchor href="#" appearance="hypertext"
|
|
169
|
+
>Limoncello and Ice Cream with Biscotti</fluent-anchor
|
|
170
|
+
>
|
|
171
|
+
</li>
|
|
172
|
+
</ol>
|
|
173
|
+
</fluent-tab-panel>
|
|
174
|
+
</fluent-tabs>
|
|
175
|
+
|
|
176
|
+
{{ radio }}
|
|
177
|
+
|
|
178
|
+
<fluent-radio-group
|
|
179
|
+
ng-observe="value"
|
|
180
|
+
data-update="radio"
|
|
181
|
+
orientation="vertical"
|
|
182
|
+
>
|
|
183
|
+
<fluent-radio value="1">18-24</fluent-radio>
|
|
184
|
+
<fluent-radio value="2">25-33</fluent-radio>
|
|
185
|
+
<fluent-radio value="3">34-44</fluent-radio>
|
|
186
|
+
<fluent-radio value="4">45+</fluent-radio>
|
|
187
|
+
</fluent-radio-group>
|
|
188
|
+
|
|
189
|
+
{{ checked }}
|
|
190
|
+
|
|
191
|
+
<fluent-switch ng-observe="aria-checked" data-update="checked">
|
|
192
|
+
<span slot="checked-message">On</span>
|
|
193
|
+
<span slot="unchecked-message">Off</span>
|
|
194
|
+
<label for="cap-switch">Captions:</label>
|
|
195
|
+
</fluent-switch>
|
|
196
|
+
</body>
|
|
197
|
+
</html>
|
package/src/public.js
CHANGED
|
@@ -75,7 +75,7 @@ import { LocationProvider } from "./core/location/location";
|
|
|
75
75
|
import { LogProvider } from "./services/log";
|
|
76
76
|
import { ParseProvider } from "./core/parser/parse";
|
|
77
77
|
import { RootScopeProvider } from "./core/scope/scope";
|
|
78
|
-
import { $QProvider
|
|
78
|
+
import { $QProvider } from "./core/q/q";
|
|
79
79
|
import { SceProvider, SceDelegateProvider } from "./core/sce/sce";
|
|
80
80
|
import { TaskTrackerFactoryProvider } from "./core/task-tracker-factory";
|
|
81
81
|
import { TemplateRequestProvider } from "./services/template-request";
|
|
@@ -116,8 +116,8 @@ import { UrlConfigProvider } from "./router/url/url-config";
|
|
|
116
116
|
import { UIRouterGlobals } from "./router/globals";
|
|
117
117
|
import { ViewService } from "./router/view/view";
|
|
118
118
|
import { TransitionProvider } from "./router/transition/transition-service";
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
119
|
+
import { StateProvider } from "./router/state/state-service";
|
|
120
|
+
import { ViewScrollProvider } from "./router/view-scroll";
|
|
121
121
|
import { TemplateFactoryProvider } from "./router/template-factory";
|
|
122
122
|
import { UrlService } from "./router/url/url-service";
|
|
123
123
|
import { StateRegistryProvider } from "./router/state/state-registry";
|
|
@@ -128,6 +128,7 @@ import {
|
|
|
128
128
|
$StateRefDynamicDirective,
|
|
129
129
|
} from "./router/directives/state-directives";
|
|
130
130
|
import { $ViewDirectiveFill, ngView } from "./router/directives/view-directive";
|
|
131
|
+
import { ngObserveDirective } from "./directive/observe/observe";
|
|
131
132
|
|
|
132
133
|
/**
|
|
133
134
|
* @type {string} `version` from `package.json`, injected by Rollup plugin
|
|
@@ -187,6 +188,7 @@ export function publishExternalAPI(angular) {
|
|
|
187
188
|
ngSwitch: ngSwitchDirective,
|
|
188
189
|
ngSwitchWhen: ngSwitchWhenDirective,
|
|
189
190
|
ngSwitchDefault: ngSwitchDefaultDirective,
|
|
191
|
+
ngObserve: ngObserveDirective,
|
|
190
192
|
ngOptions: ngOptionsDirective,
|
|
191
193
|
ngTransclude: ngTranscludeDirective,
|
|
192
194
|
ngModel: ngModelDirective,
|
|
@@ -259,7 +261,6 @@ export function publishExternalAPI(angular) {
|
|
|
259
261
|
$rootScope: RootScopeProvider,
|
|
260
262
|
$routerGlobals: UIRouterGlobals,
|
|
261
263
|
$q: $QProvider,
|
|
262
|
-
$$q: $$QProvider,
|
|
263
264
|
$sce: SceProvider,
|
|
264
265
|
$sceDelegate: SceDelegateProvider,
|
|
265
266
|
$$taskTrackerFactory: TaskTrackerFactoryProvider,
|
|
@@ -269,8 +270,8 @@ export function publishExternalAPI(angular) {
|
|
|
269
270
|
$urlConfig: UrlConfigProvider,
|
|
270
271
|
$view: ViewService,
|
|
271
272
|
$transitions: TransitionProvider,
|
|
272
|
-
$state:
|
|
273
|
-
$ngViewScroll:
|
|
273
|
+
$state: StateProvider,
|
|
274
|
+
$ngViewScroll: ViewScrollProvider,
|
|
274
275
|
$templateFactory: TemplateFactoryProvider,
|
|
275
276
|
$urlService: UrlService,
|
|
276
277
|
$stateRegistry: StateRegistryProvider,
|
|
@@ -27,7 +27,7 @@ const err = minErr("$stateProvider");
|
|
|
27
27
|
*
|
|
28
28
|
* This API is located at `router.stateService` ([[UIRouter.stateService]])
|
|
29
29
|
*/
|
|
30
|
-
export class
|
|
30
|
+
export class StateProvider {
|
|
31
31
|
/**
|
|
32
32
|
* The latest successful state parameters
|
|
33
33
|
*
|
|
@@ -73,11 +73,11 @@ export class StateService {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
const getters = ["current", "$current", "params", "transition"];
|
|
76
|
-
const boundFns = Object.keys(
|
|
76
|
+
const boundFns = Object.keys(StateProvider.prototype).filter(
|
|
77
77
|
(x) => !getters.includes(x),
|
|
78
78
|
);
|
|
79
79
|
createProxyFunctions(
|
|
80
|
-
val(
|
|
80
|
+
val(StateProvider.prototype),
|
|
81
81
|
this,
|
|
82
82
|
val(this),
|
|
83
83
|
boundFns,
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export class ViewScrollProvider {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.enabled = false;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
useAnchorScroll() {
|
|
7
|
+
this.enabled = true;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
$get = [
|
|
7
11
|
"$anchorScroll",
|
|
8
12
|
"$timeout",
|
|
9
13
|
/**
|
|
@@ -12,15 +16,16 @@ export function $ViewScrollProvider() {
|
|
|
12
16
|
* @returns {import('../services/anchor-scroll').AnchorScrollObject|Function}
|
|
13
17
|
*/
|
|
14
18
|
($anchorScroll, $timeout) => {
|
|
15
|
-
if (
|
|
19
|
+
if (this.enabled) {
|
|
16
20
|
return $anchorScroll;
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* @param {import('../shared/jqlite/jqlite').JQLite} $element
|
|
24
|
+
* @returns {import('../core/q/q').QPromise<any>}
|
|
20
25
|
*/
|
|
21
26
|
return function ($element) {
|
|
22
27
|
return $timeout(
|
|
23
|
-
|
|
28
|
+
() => {
|
|
24
29
|
$element[0].scrollIntoView();
|
|
25
30
|
},
|
|
26
31
|
0,
|
package/src/services/log.js
CHANGED
|
@@ -30,12 +30,6 @@ export let LogService = {
|
|
|
30
30
|
warn: undefined,
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
* @typedef {import('../types').ServiceProvider} LogProvider
|
|
35
|
-
* @property {function(): boolean} debugEnabled - Function to get the current debug state.
|
|
36
|
-
* @property {function(boolean): angular.LogProvider} debugEnabled - Function to enable or disable debug.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
33
|
/**
|
|
40
34
|
* @type {LogProvider}
|
|
41
35
|
* Use the `$logProvider` to configure how the application logs messages
|
|
@@ -9,15 +9,15 @@ export class Attributes {
|
|
|
9
9
|
/**
|
|
10
10
|
* @param {import('../scope/scope').Scope} $rootScope
|
|
11
11
|
* @param {*} $animate
|
|
12
|
-
* @param {import("../exception-handler").
|
|
12
|
+
* @param {import("../exception-handler").ErrorHandler} $exceptionHandler
|
|
13
13
|
* @param {*} $sce
|
|
14
14
|
* @param {import('../../shared/jqlite/jqlite').JQLite} [element]
|
|
15
15
|
* @param {*} [attributesToCopy]
|
|
16
16
|
*/
|
|
17
|
-
constructor($rootScope: import("../scope/scope").Scope, $animate: any, $exceptionHandler: import("../exception-handler").
|
|
17
|
+
constructor($rootScope: import("../scope/scope").Scope, $animate: any, $exceptionHandler: import("../exception-handler").ErrorHandler, $sce: any, element?: import("../../shared/jqlite/jqlite").JQLite, attributesToCopy?: any);
|
|
18
18
|
$rootScope: import("../scope/scope").Scope;
|
|
19
19
|
$animate: any;
|
|
20
|
-
$exceptionHandler: import("../exception-handler").
|
|
20
|
+
$exceptionHandler: import("../exception-handler").ErrorHandler;
|
|
21
21
|
$sce: any;
|
|
22
22
|
$attr: {};
|
|
23
23
|
$$element: import("../../shared/jqlite/jqlite").JQLite;
|
|
@@ -99,7 +99,7 @@ export class CompileProvider {
|
|
|
99
99
|
* @returns {object} `this` for chaining
|
|
100
100
|
*/
|
|
101
101
|
addPropertySecurityContext: (elementName: string, propertyName: string, ctx: string) => object;
|
|
102
|
-
$get: (string | (($injector: import("../../core/di/internal-injector").InjectorService, $interpolate: any, $exceptionHandler: import("../exception-handler").
|
|
102
|
+
$get: (string | (($injector: import("../../core/di/internal-injector").InjectorService, $interpolate: any, $exceptionHandler: import("../exception-handler").ErrorHandler, $templateRequest: any, $parse: import("../parser/parse").ParseService, $controller: any, $rootScope: import("../scope/scope").Scope, $sce: any, $animate: any) => ($compileNodes: string | NodeList, transcludeFn: any, maxPriority: any, ignoreDirective: any, previousCompileContext: any) => (scope: any, cloneConnectFn: any, options: any) => JQLite))[];
|
|
103
103
|
}
|
|
104
104
|
export namespace CompileProvider {
|
|
105
105
|
let $inject: string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @constructor
|
|
3
|
-
* @this {
|
|
3
|
+
* @this {import('../types').ServiceProvider}
|
|
4
4
|
*/
|
|
5
|
-
export function ExceptionHandlerProvider(this:
|
|
5
|
+
export function ExceptionHandlerProvider(this: any): void;
|
|
6
6
|
export class ExceptionHandlerProvider {
|
|
7
7
|
$get: (string | (($log: import("../services/log").LogService) => ErrorHandler))[];
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export function $IntervalFactoryProvider(): void;
|
|
2
2
|
export class $IntervalFactoryProvider {
|
|
3
|
-
$get: (string | (($
|
|
3
|
+
$get: (string | (($q: any, $rootScope: import("../scope/scope").Scope) => (setIntervalFn: any, clearIntervalFn: any) => (fn: any, delay: any, count: any, ...args: any[]) => any))[];
|
|
4
4
|
}
|
package/types/core/q/q.d.ts
CHANGED
|
@@ -52,11 +52,6 @@ export class $QProvider {
|
|
|
52
52
|
*/
|
|
53
53
|
errorOnUnhandledRejections(value?: boolean | undefined): boolean | $QProvider;
|
|
54
54
|
}
|
|
55
|
-
export class $$QProvider {
|
|
56
|
-
errorOn: boolean;
|
|
57
|
-
$get: (string | (($exceptionHandler: any) => any))[];
|
|
58
|
-
errorOnUnhandledRejections(value: any): boolean | this;
|
|
59
|
-
}
|
|
60
55
|
export type QService = {
|
|
61
56
|
defer: () => Deferred<any>;
|
|
62
57
|
all: (arg0: any | null) => QPromise<any>;
|
|
@@ -73,6 +73,7 @@ export const $$applyAsyncQueue: Function[];
|
|
|
73
73
|
*
|
|
74
74
|
*/
|
|
75
75
|
export class RootScopeProvider {
|
|
76
|
+
rootScope: Scope;
|
|
76
77
|
$get: (string | ((exceptionHandler: import("../exception-handler").ErrorHandler, parse: import("../parser/parse").ParseService, browser: import("../../services/browser").Browser) => Scope))[];
|
|
77
78
|
}
|
|
78
79
|
/**
|
|
@@ -100,6 +101,14 @@ export class RootScopeProvider {
|
|
|
100
101
|
* to construct.
|
|
101
102
|
*/
|
|
102
103
|
export class Scope {
|
|
104
|
+
/**
|
|
105
|
+
* @param {boolean} [root=false] - Indicates if this scope is the root scope.
|
|
106
|
+
*/
|
|
107
|
+
constructor(root?: boolean);
|
|
108
|
+
/**
|
|
109
|
+
* @type {boolean}
|
|
110
|
+
*/
|
|
111
|
+
isRoot: boolean;
|
|
103
112
|
/**
|
|
104
113
|
* @type {number} Unique scope ID (monotonically increasing) useful for debugging.
|
|
105
114
|
*/
|
|
@@ -142,8 +151,8 @@ export class Scope {
|
|
|
142
151
|
$$destroyed: boolean;
|
|
143
152
|
/** @type {boolean} */
|
|
144
153
|
$$suspended: boolean;
|
|
145
|
-
/** @type {
|
|
146
|
-
$$listeners:
|
|
154
|
+
/** @type {Map<String, Function[]>} */
|
|
155
|
+
$$listeners: Map<string, Function[]>;
|
|
147
156
|
/** @type {object} */
|
|
148
157
|
$$listenerCount: object;
|
|
149
158
|
/** @type {number} */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export class TimeoutProvider {
|
|
2
|
-
$get: (string | (($rootScope: import("../scope/scope").Scope, $browser: import("../../services/browser").Browser, $q: any,
|
|
3
|
-
(fn?: (() => any) | undefined, delay?: number | undefined, invokeApply?: boolean
|
|
2
|
+
$get: (string | (($rootScope: import("../scope/scope").Scope, $browser: import("../../services/browser").Browser, $q: any, $exceptionHandler: import("../exception-handler").ErrorHandler) => {
|
|
3
|
+
(fn?: (() => any) | undefined, delay?: number | undefined, invokeApply?: boolean, ...args: any[]): import("../q/q").QPromise<any>;
|
|
4
4
|
/**
|
|
5
5
|
* Cancels a task associated with the `promise`. As a result of this, the promise will be
|
|
6
6
|
* resolved with a rejection.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
useAnchorScroll
|
|
1
|
+
export class ViewScrollProvider {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
useAnchorScroll(): void;
|
|
4
4
|
$get: (string | (($anchorScroll: import("../services/anchor-scroll").AnchorScrollObject, $timeout: any) => import("../services/anchor-scroll").AnchorScrollObject | Function))[];
|
|
5
5
|
}
|
package/types/services/log.d.ts
CHANGED
|
@@ -35,11 +35,6 @@ export type LogService = {
|
|
|
35
35
|
* @type {LogService}
|
|
36
36
|
*/
|
|
37
37
|
export let LogService: LogService;
|
|
38
|
-
/**
|
|
39
|
-
* @typedef {import('../types').ServiceProvider} LogProvider
|
|
40
|
-
* @property {function(): boolean} debugEnabled - Function to get the current debug state.
|
|
41
|
-
* @property {function(boolean): angular.LogProvider} debugEnabled - Function to enable or disable debug.
|
|
42
|
-
*/
|
|
43
38
|
/**
|
|
44
39
|
* @type {LogProvider}
|
|
45
40
|
* Use the `$logProvider` to configure how the application logs messages
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
name: Lint check
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [ main, master ]
|
|
5
|
-
pull_request:
|
|
6
|
-
branches: [ main, master ]
|
|
7
|
-
jobs:
|
|
8
|
-
test:
|
|
9
|
-
timeout-minutes: 60
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v4
|
|
13
|
-
- uses: actions/setup-node@v4
|
|
14
|
-
with:
|
|
15
|
-
node-version: lts/*
|
|
16
|
-
- name: Install dependencies
|
|
17
|
-
run: npm ci
|
|
18
|
-
- name: Run lint check
|
|
19
|
-
run: ./node_modules/.bin/eslint ./src
|