@angular-wave/angular.ts 0.4.4 → 0.4.6
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 -0
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -12
- package/index.html +3 -74
- package/package.json +1 -1
- package/src/angular.spec.js +5 -0
- package/src/animations/animate-css.js +13 -5
- package/src/animations/animate-queue.js +21 -22
- package/src/animations/animate-runner.js +8 -4
- package/src/animations/animate.md +1 -1
- package/src/animations/animate.spec.js +21 -0
- package/src/animations/animation.js +1 -1
- package/src/binding.spec.js +1 -0
- package/src/core/compile/compile.js +25 -27
- package/src/core/compile/compile.spec.js +266 -17
- package/src/core/controller/controller.js +0 -2
- package/src/core/di/injector.md +1 -1
- package/src/core/di/injector.spec.js +2 -0
- package/src/core/di/internal-injector.js +1 -2
- package/src/core/interpolate/interpolate.js +12 -28
- package/src/core/interpolate/interpolate.spec.js +16 -70
- package/src/core/interval/interval-factory.js +50 -0
- package/src/core/interval/interval.html +18 -0
- package/src/core/interval/interval.js +77 -0
- package/src/core/interval/interval.md +123 -0
- package/src/core/interval/interval.spec.js +280 -0
- package/src/core/interval/interval.test.js +1 -1
- package/src/core/location/location.js +53 -59
- package/src/core/location/location.spec.js +27 -27
- package/src/core/on.spec.js +7 -0
- package/src/core/parse/interpreter.js +7 -10
- package/src/core/parse/parse.js +5 -26
- package/src/core/parse/parse.spec.js +91 -95
- package/src/core/prop.spec.js +60 -4
- package/src/core/q/q.html +18 -0
- package/src/core/q/q.js +472 -0
- package/src/core/q/q.md +211 -0
- package/src/core/q/q.spec.js +2748 -0
- package/src/core/q/q.test.js +12 -0
- package/src/core/sce/sce.spec.js +8 -0
- package/src/core/{model/model.html → scope/scope.html} +1 -1
- package/src/core/scope/scope.js +16 -15
- package/src/core/scope/scope.spec.js +1959 -24
- package/src/core/scope/scope.test.js +12 -0
- package/src/core/timeout/timeout.html +18 -0
- package/src/core/timeout/timeout.js +109 -0
- package/src/core/timeout/timeout.spec.js +354 -0
- package/src/core/timeout/timout.test.js +12 -0
- package/src/core/url-utils/url-utils.spec.js +1 -1
- package/src/directive/aria/aria.js +6 -3
- package/src/directive/aria/aria.spec.js +87 -0
- package/src/directive/attrs/attrs.spec.js +5 -0
- package/src/directive/attrs/boolean.spec.js +15 -0
- package/src/directive/attrs/element-style.spec.js +8 -0
- package/src/directive/attrs/src.spec.js +7 -0
- package/src/directive/bind/bind.spec.js +33 -0
- package/src/directive/bind/bing-html.spec.js +3 -0
- package/src/directive/class/class.js +3 -3
- package/src/directive/class/class.spec.js +75 -9
- package/src/directive/controller/controller.spec.js +13 -0
- package/src/directive/events/click.spec.js +3 -0
- package/src/directive/events/event.spec.js +6 -0
- package/src/directive/events/events.html +1 -0
- package/src/directive/form/form.js +3 -2
- package/src/directive/form/form.spec.js +65 -0
- package/src/directive/if/if.spec.js +4 -0
- package/src/directive/include/include.spec.js +59 -8
- package/src/directive/init/init.js +2 -6
- package/src/directive/init/init.spec.js +2 -0
- package/src/directive/input/input.spec.js +136 -0
- package/src/directive/messages/messages.spec.js +35 -4
- package/src/directive/model/model.js +25 -18
- package/src/directive/model/model.spec.js +49 -2
- package/src/directive/model-options/model-options.spec.js +6 -0
- package/src/directive/non-bindable/non-bindable.spec.js +1 -0
- package/src/directive/observe/observe.js +5 -1
- package/src/directive/observe/observe.spec.js +22 -0
- package/src/directive/observe/test.html +3 -11
- package/src/directive/options/options.spec.js +34 -0
- package/src/directive/ref/href.spec.js +15 -0
- package/src/directive/repeat/repeat.spec.js +135 -8
- package/src/directive/script/script.spec.js +2 -0
- package/src/directive/select/select.js +3 -3
- package/src/directive/select/select.spec.js +96 -0
- package/src/directive/show-hide/show-hide.js +2 -2
- package/src/directive/show-hide/show-hide.spec.js +19 -8
- package/src/directive/style/style.spec.js +7 -0
- package/src/directive/switch/switch.spec.js +5 -5
- package/src/directive/validators/validators.spec.js +1 -0
- package/src/loader.js +1 -0
- package/src/public.js +10 -2
- package/src/router/common/coreservices.js +2 -0
- package/src/router/directives/state-directives.js +14 -6
- package/src/router/directives/state-directives.spec.js +83 -0
- package/src/router/directives/view-directive.js +13 -4
- package/src/router/directives/view-directive.spec.js +71 -25
- package/src/router/hooks/lazy-load.js +2 -2
- package/src/router/hooks/views.js +5 -3
- package/src/router/resolve/resolvable.js +6 -3
- package/src/router/resolve/resolve-context.js +2 -2
- package/src/router/state/state-service.js +4 -4
- package/src/router/state/state.spec.js +5 -2
- package/src/router/state/state.test.js +1 -1
- package/src/router/state/views.js +10 -7
- package/src/router/template-factory.js +6 -3
- package/src/router/template-factory.spec.js +4 -0
- package/src/router/transition/transition-hook.js +1 -1
- package/src/router/transition/transition.js +1 -1
- package/src/router/view-hook.spec.js +2 -2
- package/src/router/view-scroll.js +6 -4
- package/src/services/browser.js +5 -8
- package/src/services/http/http.js +9 -6
- package/src/services/http/http.spec.js +31 -30
- package/src/services/http/template-request.spec.js +10 -0
- package/src/services/http-backend/http-backend.spec.js +3 -3
- package/src/services/template-request.js +4 -2
- package/src/shared/common.js +2 -1
- package/types/core/location/location.d.ts +37 -34
- package/types/core/parse/parse.d.ts +0 -26
- package/types/core/scope/scope.d.ts +11 -11
- package/src/core/model/model.js +0 -944
- package/src/core/model/model.spec.js +0 -3012
- package/types/core/model/model.d.ts +0 -204
|
@@ -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
|
+
});
|
package/src/core/sce/sce.spec.js
CHANGED
|
@@ -202,14 +202,18 @@ describe("SCE", () => {
|
|
|
202
202
|
logs.push(`${value}`);
|
|
203
203
|
});
|
|
204
204
|
|
|
205
|
+
$rootScope.$digest();
|
|
205
206
|
expect(logs[0]).toEqual("undefined"); // initial listener call
|
|
206
207
|
|
|
207
208
|
$rootScope.foo = $sce.trustAs($sce.HTML, "trustedValue");
|
|
208
209
|
expect($rootScope.$$watchers.length).toBe(1);
|
|
210
|
+
$rootScope.$digest();
|
|
211
|
+
|
|
209
212
|
expect($rootScope.$$watchers.length).toBe(0);
|
|
210
213
|
expect(logs[1]).toEqual("trustedValue");
|
|
211
214
|
|
|
212
215
|
$rootScope.foo = $sce.trustAs($sce.HTML, "anotherTrustedValue");
|
|
216
|
+
$rootScope.$digest();
|
|
213
217
|
expect(logs[2]).toBeUndefined(); // watcher no longer active
|
|
214
218
|
});
|
|
215
219
|
|
|
@@ -218,14 +222,18 @@ describe("SCE", () => {
|
|
|
218
222
|
logs.push(`${value}`);
|
|
219
223
|
});
|
|
220
224
|
|
|
225
|
+
$rootScope.$digest();
|
|
221
226
|
expect(logs[0]).toEqual("undefined"); // initial listener call
|
|
222
227
|
|
|
223
228
|
$rootScope.foo = $sce.trustAs($sce.URL, "trustedValue");
|
|
224
229
|
expect($rootScope.$$watchers.length).toBe(1);
|
|
230
|
+
$rootScope.$digest();
|
|
231
|
+
|
|
225
232
|
expect($rootScope.$$watchers.length).toBe(0);
|
|
226
233
|
expect(logs[1]).toEqual("trustedValue");
|
|
227
234
|
|
|
228
235
|
$rootScope.foo = $sce.trustAs($sce.URL, "anotherTrustedValue");
|
|
236
|
+
$rootScope.$digest();
|
|
229
237
|
expect(logs[2]).toBeUndefined(); // watcher no longer active
|
|
230
238
|
});
|
|
231
239
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
11
|
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
12
|
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
-
<script type="module" src="/src/core/
|
|
13
|
+
<script type="module" src="/src/core/scope/scope.spec.js"></script>
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="dummy"></div>
|
package/src/core/scope/scope.js
CHANGED
|
@@ -57,7 +57,7 @@ const $rootScopeMinErr = minErr("$rootScope");
|
|
|
57
57
|
|
|
58
58
|
/** @type {AsyncQueueTask[]} */
|
|
59
59
|
export const $$asyncQueue = [];
|
|
60
|
-
export const
|
|
60
|
+
export const $$postDigestQueue = [];
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* @type {Function[]}
|
|
@@ -363,16 +363,16 @@ export class Scope {
|
|
|
363
363
|
});
|
|
364
364
|
expect(scope.counter).toEqual(0);
|
|
365
365
|
|
|
366
|
-
;
|
|
366
|
+
scope.$digest();
|
|
367
367
|
// the listener is always called during the first $digest loop after it was registered
|
|
368
368
|
expect(scope.counter).toEqual(1);
|
|
369
369
|
|
|
370
|
-
;
|
|
370
|
+
scope.$digest();
|
|
371
371
|
// but now it will not be called unless the value changes
|
|
372
372
|
expect(scope.counter).toEqual(1);
|
|
373
373
|
|
|
374
374
|
scope.name = 'adam';
|
|
375
|
-
;
|
|
375
|
+
scope.$digest();
|
|
376
376
|
expect(scope.counter).toEqual(2);
|
|
377
377
|
|
|
378
378
|
// Using a function as a watchExpression
|
|
@@ -394,12 +394,12 @@ export class Scope {
|
|
|
394
394
|
expect(scope.foodCounter).toEqual(0);
|
|
395
395
|
|
|
396
396
|
// Run the digest but since food has not changed count will still be zero
|
|
397
|
-
;
|
|
397
|
+
scope.$digest();
|
|
398
398
|
expect(scope.foodCounter).toEqual(0);
|
|
399
399
|
|
|
400
400
|
// Update food and run digest. Now the counter will increment
|
|
401
401
|
food = 'cheeseburger';
|
|
402
|
-
;
|
|
402
|
+
scope.$digest();
|
|
403
403
|
expect(scope.foodCounter).toEqual(1);
|
|
404
404
|
|
|
405
405
|
* ```
|
|
@@ -706,6 +706,7 @@ export class Scope {
|
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
|
+
// TODO: fix this type signature
|
|
709
710
|
return this.$watch(changeDetector, $watchCollectionAction);
|
|
710
711
|
}
|
|
711
712
|
|
|
@@ -741,16 +742,16 @@ export class Scope {
|
|
|
741
742
|
});
|
|
742
743
|
expect(scope.counter).toEqual(0);
|
|
743
744
|
|
|
744
|
-
;
|
|
745
|
+
scope.$digest();
|
|
745
746
|
// the listener is always called during the first $digest loop after it was registered
|
|
746
747
|
expect(scope.counter).toEqual(1);
|
|
747
748
|
|
|
748
|
-
;
|
|
749
|
+
scope.$digest();
|
|
749
750
|
// but now it will not be called unless the value changes
|
|
750
751
|
expect(scope.counter).toEqual(1);
|
|
751
752
|
|
|
752
753
|
scope.name = 'adam';
|
|
753
|
-
;
|
|
754
|
+
scope.$digest();
|
|
754
755
|
expect(scope.counter).toEqual(2);
|
|
755
756
|
* ```
|
|
756
757
|
*
|
|
@@ -892,14 +893,14 @@ export class Scope {
|
|
|
892
893
|
this.clearPhase();
|
|
893
894
|
|
|
894
895
|
// postDigestQueuePosition isn't local here because this loop can be reentered recursively.
|
|
895
|
-
while (postDigestQueuePosition <
|
|
896
|
+
while (postDigestQueuePosition < $$postDigestQueue.length) {
|
|
896
897
|
try {
|
|
897
|
-
|
|
898
|
+
$$postDigestQueue[postDigestQueuePosition++]();
|
|
898
899
|
} catch (e) {
|
|
899
900
|
$exceptionHandler(e);
|
|
900
901
|
}
|
|
901
902
|
}
|
|
902
|
-
|
|
903
|
+
$$postDigestQueue.length = postDigestQueuePosition = 0;
|
|
903
904
|
|
|
904
905
|
// Check for changes to browser url that happened during the $digest
|
|
905
906
|
// (for which no event is fired; e.g. via `history.pushState()`)
|
|
@@ -936,7 +937,7 @@ export class Scope {
|
|
|
936
937
|
* Some of the things to consider are:
|
|
937
938
|
*
|
|
938
939
|
* * Any external event on a directive/component will not trigger a digest while the hosting
|
|
939
|
-
* scope is suspended - even if the event handler calls `$apply()` or
|
|
940
|
+
* scope is suspended - even if the event handler calls `$apply()` or `$rootScope.$digest()`.
|
|
940
941
|
* * Transcluded content exists on a scope that inherits from outside a directive but exists
|
|
941
942
|
* as a child of the directive's containing scope. If the containing scope is suspended the
|
|
942
943
|
* transcluded scope will also be suspended, even if the scope from which the transcluded
|
|
@@ -1150,8 +1151,8 @@ export class Scope {
|
|
|
1150
1151
|
return id;
|
|
1151
1152
|
}
|
|
1152
1153
|
|
|
1153
|
-
|
|
1154
|
-
|
|
1154
|
+
$$postDigest(fn) {
|
|
1155
|
+
$$postDigestQueue.push(fn);
|
|
1155
1156
|
}
|
|
1156
1157
|
|
|
1157
1158
|
/**
|