@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.
Files changed (123) hide show
  1. package/Makefile +1 -0
  2. package/dist/angular-ts.esm.js +2 -2
  3. package/dist/angular-ts.umd.js +2 -12
  4. package/index.html +3 -74
  5. package/package.json +1 -1
  6. package/src/angular.spec.js +5 -0
  7. package/src/animations/animate-css.js +13 -5
  8. package/src/animations/animate-queue.js +21 -22
  9. package/src/animations/animate-runner.js +8 -4
  10. package/src/animations/animate.md +1 -1
  11. package/src/animations/animate.spec.js +21 -0
  12. package/src/animations/animation.js +1 -1
  13. package/src/binding.spec.js +1 -0
  14. package/src/core/compile/compile.js +25 -27
  15. package/src/core/compile/compile.spec.js +266 -17
  16. package/src/core/controller/controller.js +0 -2
  17. package/src/core/di/injector.md +1 -1
  18. package/src/core/di/injector.spec.js +2 -0
  19. package/src/core/di/internal-injector.js +1 -2
  20. package/src/core/interpolate/interpolate.js +12 -28
  21. package/src/core/interpolate/interpolate.spec.js +16 -70
  22. package/src/core/interval/interval-factory.js +50 -0
  23. package/src/core/interval/interval.html +18 -0
  24. package/src/core/interval/interval.js +77 -0
  25. package/src/core/interval/interval.md +123 -0
  26. package/src/core/interval/interval.spec.js +280 -0
  27. package/src/core/interval/interval.test.js +1 -1
  28. package/src/core/location/location.js +53 -59
  29. package/src/core/location/location.spec.js +27 -27
  30. package/src/core/on.spec.js +7 -0
  31. package/src/core/parse/interpreter.js +7 -10
  32. package/src/core/parse/parse.js +5 -26
  33. package/src/core/parse/parse.spec.js +91 -95
  34. package/src/core/prop.spec.js +60 -4
  35. package/src/core/q/q.html +18 -0
  36. package/src/core/q/q.js +472 -0
  37. package/src/core/q/q.md +211 -0
  38. package/src/core/q/q.spec.js +2748 -0
  39. package/src/core/q/q.test.js +12 -0
  40. package/src/core/sce/sce.spec.js +8 -0
  41. package/src/core/{model/model.html → scope/scope.html} +1 -1
  42. package/src/core/scope/scope.js +16 -15
  43. package/src/core/scope/scope.spec.js +1959 -24
  44. package/src/core/scope/scope.test.js +12 -0
  45. package/src/core/timeout/timeout.html +18 -0
  46. package/src/core/timeout/timeout.js +109 -0
  47. package/src/core/timeout/timeout.spec.js +354 -0
  48. package/src/core/timeout/timout.test.js +12 -0
  49. package/src/core/url-utils/url-utils.spec.js +1 -1
  50. package/src/directive/aria/aria.js +6 -3
  51. package/src/directive/aria/aria.spec.js +87 -0
  52. package/src/directive/attrs/attrs.spec.js +5 -0
  53. package/src/directive/attrs/boolean.spec.js +15 -0
  54. package/src/directive/attrs/element-style.spec.js +8 -0
  55. package/src/directive/attrs/src.spec.js +7 -0
  56. package/src/directive/bind/bind.spec.js +33 -0
  57. package/src/directive/bind/bing-html.spec.js +3 -0
  58. package/src/directive/class/class.js +3 -3
  59. package/src/directive/class/class.spec.js +75 -9
  60. package/src/directive/controller/controller.spec.js +13 -0
  61. package/src/directive/events/click.spec.js +3 -0
  62. package/src/directive/events/event.spec.js +6 -0
  63. package/src/directive/events/events.html +1 -0
  64. package/src/directive/form/form.js +3 -2
  65. package/src/directive/form/form.spec.js +65 -0
  66. package/src/directive/if/if.spec.js +4 -0
  67. package/src/directive/include/include.spec.js +59 -8
  68. package/src/directive/init/init.js +2 -6
  69. package/src/directive/init/init.spec.js +2 -0
  70. package/src/directive/input/input.spec.js +136 -0
  71. package/src/directive/messages/messages.spec.js +35 -4
  72. package/src/directive/model/model.js +25 -18
  73. package/src/directive/model/model.spec.js +49 -2
  74. package/src/directive/model-options/model-options.spec.js +6 -0
  75. package/src/directive/non-bindable/non-bindable.spec.js +1 -0
  76. package/src/directive/observe/observe.js +5 -1
  77. package/src/directive/observe/observe.spec.js +22 -0
  78. package/src/directive/observe/test.html +3 -11
  79. package/src/directive/options/options.spec.js +34 -0
  80. package/src/directive/ref/href.spec.js +15 -0
  81. package/src/directive/repeat/repeat.spec.js +135 -8
  82. package/src/directive/script/script.spec.js +2 -0
  83. package/src/directive/select/select.js +3 -3
  84. package/src/directive/select/select.spec.js +96 -0
  85. package/src/directive/show-hide/show-hide.js +2 -2
  86. package/src/directive/show-hide/show-hide.spec.js +19 -8
  87. package/src/directive/style/style.spec.js +7 -0
  88. package/src/directive/switch/switch.spec.js +5 -5
  89. package/src/directive/validators/validators.spec.js +1 -0
  90. package/src/loader.js +1 -0
  91. package/src/public.js +10 -2
  92. package/src/router/common/coreservices.js +2 -0
  93. package/src/router/directives/state-directives.js +14 -6
  94. package/src/router/directives/state-directives.spec.js +83 -0
  95. package/src/router/directives/view-directive.js +13 -4
  96. package/src/router/directives/view-directive.spec.js +71 -25
  97. package/src/router/hooks/lazy-load.js +2 -2
  98. package/src/router/hooks/views.js +5 -3
  99. package/src/router/resolve/resolvable.js +6 -3
  100. package/src/router/resolve/resolve-context.js +2 -2
  101. package/src/router/state/state-service.js +4 -4
  102. package/src/router/state/state.spec.js +5 -2
  103. package/src/router/state/state.test.js +1 -1
  104. package/src/router/state/views.js +10 -7
  105. package/src/router/template-factory.js +6 -3
  106. package/src/router/template-factory.spec.js +4 -0
  107. package/src/router/transition/transition-hook.js +1 -1
  108. package/src/router/transition/transition.js +1 -1
  109. package/src/router/view-hook.spec.js +2 -2
  110. package/src/router/view-scroll.js +6 -4
  111. package/src/services/browser.js +5 -8
  112. package/src/services/http/http.js +9 -6
  113. package/src/services/http/http.spec.js +31 -30
  114. package/src/services/http/template-request.spec.js +10 -0
  115. package/src/services/http-backend/http-backend.spec.js +3 -3
  116. package/src/services/template-request.js +4 -2
  117. package/src/shared/common.js +2 -1
  118. package/types/core/location/location.d.ts +37 -34
  119. package/types/core/parse/parse.d.ts +0 -26
  120. package/types/core/scope/scope.d.ts +11 -11
  121. package/src/core/model/model.js +0 -944
  122. package/src/core/model/model.spec.js +0 -3012
  123. 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/scope/scope.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
+ });
@@ -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/core/timeout/timeout.spec.js"></script>
14
+ </head>
15
+ <body>
16
+ <div id="dummy"></div>
17
+ </body>
18
+ </html>
@@ -0,0 +1,109 @@
1
+ import { markQExceptionHandled } from "../q/q";
2
+ import { isDefined, minErr, sliceArgs } from "../../shared/utils";
3
+
4
+ const $timeoutMinErr = minErr("$timeout");
5
+
6
+ export class TimeoutProvider {
7
+ $get = [
8
+ "$rootScope",
9
+ "$browser",
10
+ "$q",
11
+ "$exceptionHandler",
12
+ /**
13
+ *
14
+ * @param {import('../scope/scope').Scope} $rootScope
15
+ * @param {import('../../services/browser').Browser} $browser
16
+ * @param {*} $q
17
+ * @param {import('../exception-handler').ErrorHandler} $exceptionHandler
18
+ * @returns
19
+ */
20
+ ($rootScope, $browser, $q, $exceptionHandler) => {
21
+ const deferreds = {};
22
+
23
+ /**
24
+
25
+ * AngularJS's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch
26
+ * block and delegates any exceptions to
27
+ * {@link $exceptionHandler} service.
28
+ *
29
+ * The return value of calling `$timeout` is a promise, which will be resolved when
30
+ * the delay has passed and the timeout function, if provided, is executed.
31
+ *
32
+ * To cancel a timeout request, call `$timeout.cancel(promise)`.
33
+ *
34
+ * If you only want a promise that will be resolved after some specified delay
35
+ * then you can call `$timeout` without the `fn` function.
36
+ *
37
+ * @param {function()=} fn A function, whose execution should be delayed.
38
+ * @param {number=} [delay=0] Delay in milliseconds.
39
+ * @returns {import("../q/q").QPromise<any>} Promise that will be resolved when the timeout is reached. The promise
40
+ * will be resolved with the return value of the `fn` function.
41
+ *
42
+ */
43
+ function timeout(fn, delay, invokeApply = true) {
44
+ const args = sliceArgs(arguments, 3);
45
+ const skipApply = isDefined(invokeApply) && !invokeApply;
46
+ const deferred = $q.defer();
47
+ const { promise } = deferred;
48
+ let timeoutId;
49
+
50
+ timeoutId = $browser.defer(
51
+ () => {
52
+ try {
53
+ deferred.resolve(fn.apply(null, args));
54
+ } catch (e) {
55
+ deferred.reject(e);
56
+ $exceptionHandler(e);
57
+ } finally {
58
+ delete deferreds[promise.$$timeoutId];
59
+ }
60
+
61
+ if (!skipApply) $rootScope.$apply();
62
+ },
63
+ delay,
64
+ "$timeout",
65
+ );
66
+
67
+ promise.$$timeoutId = timeoutId;
68
+ deferreds[timeoutId] = deferred;
69
+
70
+ return promise;
71
+ }
72
+
73
+ /**
74
+ * Cancels a task associated with the `promise`. As a result of this, the promise will be
75
+ * resolved with a rejection.
76
+ *
77
+ * @param {import("../q/q").QPromise<any>} promise Promise returned by the `$timeout` function.
78
+ * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully
79
+ * canceled.
80
+ */
81
+ timeout.cancel = function (promise) {
82
+ if (!promise) return false;
83
+
84
+ if (!Object.prototype.hasOwnProperty.call(promise, "$$timeoutId")) {
85
+ throw $timeoutMinErr(
86
+ "badprom",
87
+ "`$timeout.cancel()` called with a promise that was not generated by `$timeout()`.",
88
+ );
89
+ }
90
+
91
+ if (
92
+ !Object.prototype.hasOwnProperty.call(deferreds, promise.$$timeoutId)
93
+ )
94
+ return false;
95
+ const id = promise.$$timeoutId;
96
+ const deferred = deferreds[id];
97
+
98
+ // Timeout cancels should not report an unhandled promise.
99
+ markQExceptionHandled(deferred.promise);
100
+ deferred.reject("canceled");
101
+ delete deferreds[id];
102
+
103
+ return $browser.cancel(id);
104
+ };
105
+
106
+ return timeout;
107
+ },
108
+ ];
109
+ }
@@ -0,0 +1,354 @@
1
+ import { Angular } from "../../loader";
2
+ import { createInjector } from "../di/injector";
3
+ import { wait } from "../../shared/test-utils";
4
+
5
+ describe("$timeout", () => {
6
+ let injector;
7
+ let $interval;
8
+ let $rootScope;
9
+ let errors;
10
+ let $timeout;
11
+ let $browser;
12
+ let log;
13
+
14
+ beforeEach(() => {
15
+ errors = [];
16
+ log = [];
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"]);
26
+
27
+ $interval = injector.get("$interval");
28
+ $rootScope = injector.get("$rootScope");
29
+ $timeout = injector.get("$timeout");
30
+ $browser = injector.get("$browser");
31
+ });
32
+
33
+ it("should delegate functions to $browser.defer", (done) => {
34
+ let counter = 0;
35
+ $timeout(() => {
36
+ counter++;
37
+ });
38
+
39
+ expect(counter).toBe(0);
40
+
41
+ setTimeout(() => {
42
+ expect(counter).toBe(1);
43
+ done();
44
+ });
45
+ });
46
+
47
+ it("should call $apply after each callback is executed", (done) => {
48
+ const applySpy = spyOn($rootScope, "$apply").and.callThrough();
49
+
50
+ $timeout(() => {});
51
+ expect(applySpy).not.toHaveBeenCalled();
52
+
53
+ setTimeout(() => {
54
+ expect(applySpy).toHaveBeenCalled();
55
+ applySpy.calls.reset();
56
+ });
57
+
58
+ $timeout(() => {});
59
+ $timeout(() => {});
60
+ setTimeout(() => {
61
+ expect(applySpy).toHaveBeenCalledTimes(2);
62
+ done();
63
+ });
64
+ });
65
+
66
+ it("should NOT call $apply if skipApply is set to true", (done) => {
67
+ const applySpy = spyOn($rootScope, "$apply").and.callThrough();
68
+
69
+ $timeout(() => {}, 12, false);
70
+ expect(applySpy).not.toHaveBeenCalled();
71
+
72
+ setTimeout(() => {
73
+ expect(applySpy).not.toHaveBeenCalled();
74
+ done();
75
+ });
76
+ });
77
+
78
+ it("should NOT call $evalAsync or $digest if invokeApply is set to false", (done) => {
79
+ const evalAsyncSpy = spyOn($rootScope, "$evalAsync").and.callThrough();
80
+ const digestSpy = spyOn($rootScope, "$digest").and.callThrough();
81
+ const fulfilledSpy = jasmine.createSpy("fulfilled");
82
+
83
+ $timeout(fulfilledSpy, 1, false);
84
+
85
+ setTimeout(() => {
86
+ expect(fulfilledSpy).toHaveBeenCalled();
87
+ expect(evalAsyncSpy).not.toHaveBeenCalled();
88
+ expect(digestSpy).not.toHaveBeenCalled();
89
+ done();
90
+ }, 1);
91
+ });
92
+
93
+ it("should allow you to specify the delay time", () => {
94
+ const defer = spyOn($browser, "defer");
95
+ $timeout(() => {}, 123);
96
+ expect(defer).toHaveBeenCalledTimes(1);
97
+ expect(defer.calls.mostRecent().args[1]).toEqual(123);
98
+ });
99
+
100
+ it("should return a promise which will be resolved with return value of the timeout callback", (done) => {
101
+ const promise = $timeout(() => {
102
+ log.push("timeout");
103
+ return "buba";
104
+ });
105
+
106
+ promise.then(
107
+ (value) => {
108
+ log.push(`promise success: ${value}`);
109
+ },
110
+ () => log.push("promise error"),
111
+ );
112
+ expect(log).toEqual([]);
113
+
114
+ setTimeout(() => {
115
+ expect(log).toEqual(["timeout", "promise success: buba"]);
116
+ done();
117
+ });
118
+ });
119
+
120
+ it("should allow the `fn` parameter to be optional", (done) => {
121
+ $timeout().then(
122
+ (value) => {
123
+ log.push(`promise success: ${value}`);
124
+ },
125
+ () => log.push("promise error"),
126
+ );
127
+ expect(log).toEqual([]);
128
+
129
+ setTimeout(() => {
130
+ expect(log).toEqual(["promise success: undefined"]);
131
+ log = [];
132
+ });
133
+
134
+ $timeout(1).then(
135
+ (value) => {
136
+ log.push(`promise success: ${value}`);
137
+ },
138
+ () => log.push("promise error"),
139
+ );
140
+ expect(log).toEqual([]);
141
+ setTimeout(() => {
142
+ expect(log).toEqual(["promise success: undefined"]);
143
+ done();
144
+ }, 1);
145
+ });
146
+
147
+ describe("exception handling", () => {
148
+ it("should delegate exception to the $exceptionHandler service", async () => {
149
+ errors = [];
150
+ $timeout(() => {
151
+ errors = [];
152
+ throw "Test Error";
153
+ }, 1);
154
+ expect(errors).toEqual([]);
155
+
156
+ await wait(1);
157
+ expect(errors).toEqual([
158
+ "Test Error",
159
+ "Possibly unhandled rejection: Test Error",
160
+ ]);
161
+ });
162
+
163
+ it("should call $apply even if an exception is thrown in callback", async () => {
164
+ const applySpy = spyOn($rootScope, "$apply").and.callThrough();
165
+
166
+ $timeout(() => {
167
+ throw "Test $apply";
168
+ });
169
+ expect(applySpy).not.toHaveBeenCalled();
170
+ await wait(2);
171
+ expect(applySpy).toHaveBeenCalled();
172
+ });
173
+
174
+ it("should reject the timeout promise when an exception is thrown in the timeout callback", (done) => {
175
+ const promise = $timeout(() => {
176
+ throw "Some Error";
177
+ });
178
+
179
+ promise.then(
180
+ () => log.push("success"),
181
+ (reason) => {
182
+ log.push(`error: ${reason}`);
183
+ },
184
+ );
185
+ setTimeout(() => {
186
+ expect(log).toEqual(["error: Some Error"]);
187
+ done();
188
+ });
189
+ });
190
+
191
+ it("should pass the timeout arguments in the timeout callback even if an exception is thrown", (done) => {
192
+ const promise1 = $timeout(
193
+ (arg) => {
194
+ throw arg;
195
+ },
196
+ 1,
197
+ true,
198
+ "Some Arguments",
199
+ );
200
+ const promise2 = $timeout(
201
+ (arg1, args2) => {
202
+ throw `${arg1} ${args2}`;
203
+ },
204
+ 2,
205
+ false,
206
+ "Are Meant",
207
+ "To Be Thrown",
208
+ );
209
+
210
+ promise1.then(
211
+ () => log.push("success"),
212
+ (reason) => {
213
+ log.push(`error: ${reason}`);
214
+ },
215
+ );
216
+ promise2.then(
217
+ () => log.push("success"),
218
+ (reason) => {
219
+ log.push(`error: ${reason}`);
220
+ },
221
+ );
222
+
223
+ setTimeout(() => {
224
+ expect(log).toEqual([]);
225
+ });
226
+
227
+ setTimeout(() => {
228
+ expect(log).toEqual(["error: Some Arguments"]);
229
+ }, 1);
230
+ setTimeout(() => {
231
+ expect(log).toEqual([
232
+ "error: Some Arguments",
233
+ "error: Are Meant To Be Thrown",
234
+ ]);
235
+ done();
236
+ }, 15);
237
+ });
238
+
239
+ it("should forget references to relevant deferred even when exception is thrown", () => {
240
+ var promise = $timeout(
241
+ function () {
242
+ throw "Test Error";
243
+ },
244
+ 0,
245
+ false,
246
+ );
247
+
248
+ const res = $timeout.cancel(promise);
249
+ expect(res).toBe(true);
250
+ });
251
+ });
252
+
253
+ describe("cancel", () => {
254
+ it("should cancel tasks", (done) => {
255
+ const task1 = jasmine.createSpy("task1");
256
+ const task2 = jasmine.createSpy("task2");
257
+ const task3 = jasmine.createSpy("task3");
258
+ const task4 = jasmine.createSpy("task4");
259
+ let promise1;
260
+ let promise3;
261
+ let promise4;
262
+
263
+ promise1 = $timeout(task1);
264
+ $timeout(task2);
265
+ promise3 = $timeout(task3, 333);
266
+ promise4 = $timeout(333);
267
+ promise3.then(task4, () => {});
268
+
269
+ $timeout.cancel(promise1);
270
+ $timeout.cancel(promise3);
271
+ $timeout.cancel(promise4);
272
+ setTimeout(() => {
273
+ expect(task1).not.toHaveBeenCalled();
274
+ expect(task2).toHaveBeenCalled();
275
+ expect(task3).not.toHaveBeenCalled();
276
+ expect(task4).not.toHaveBeenCalled();
277
+ done();
278
+ });
279
+ });
280
+
281
+ it("should cancel the promise", (done) => {
282
+ const promise = $timeout(() => {});
283
+ promise.then(
284
+ (value) => {
285
+ log.push(`promise success: ${value}`);
286
+ },
287
+ (err) => {
288
+ log.push(`promise error: ${err}`);
289
+ },
290
+ (note) => {
291
+ log.push(`promise update: ${note}`);
292
+ },
293
+ );
294
+ expect(log).toEqual([]);
295
+
296
+ $timeout.cancel(promise);
297
+ setTimeout(() => {
298
+ expect(log).toEqual(["promise error: canceled"]);
299
+ done();
300
+ });
301
+ });
302
+
303
+ it("should return true if a task was successfully canceled", (done) => {
304
+ const task1 = jasmine.createSpy("task1");
305
+ const task2 = jasmine.createSpy("task2");
306
+ let promise1;
307
+ let promise2;
308
+
309
+ promise1 = $timeout(task1);
310
+ setTimeout(() => {
311
+ promise2 = $timeout(task2);
312
+
313
+ expect($timeout.cancel(promise1)).toBe(false);
314
+ expect($timeout.cancel(promise2)).toBe(true);
315
+ done();
316
+ });
317
+ });
318
+
319
+ it("should not throw an error when given an undefined promise", () => {
320
+ expect($timeout.cancel()).toBe(false);
321
+ });
322
+
323
+ it("should throw an error when given a non-$timeout promise", () => {
324
+ const promise = $timeout(() => {}).then(() => {});
325
+ expect(() => {
326
+ $timeout.cancel(promise);
327
+ }).toThrowError(/badprom/);
328
+ });
329
+
330
+ it("should forget references to relevant deferred", () => {
331
+ // $browser.cancel is only called on cancel if the deferred object is still referenced
332
+ const cancelSpy = spyOn($browser, "cancel").and.callThrough();
333
+
334
+ const promise = $timeout(() => {}, 0, false);
335
+
336
+ expect(cancelSpy).not.toHaveBeenCalled();
337
+ $timeout.cancel(promise);
338
+ expect(cancelSpy).toHaveBeenCalled();
339
+
340
+ // Promise deferred object should already be removed from the list and not cancellable again
341
+ $timeout.cancel(promise);
342
+ expect(cancelSpy).toHaveBeenCalled();
343
+ });
344
+
345
+ it("should not trigger digest when cancelled", () => {
346
+ const watchSpy = jasmine.createSpy("watchSpy");
347
+ $rootScope.$watch(watchSpy);
348
+
349
+ const t = $timeout();
350
+ $timeout.cancel(t);
351
+ expect(watchSpy).not.toHaveBeenCalled();
352
+ });
353
+ });
354
+ });
@@ -0,0 +1,12 @@
1
+ import { test, expect } from "@playwright/test";
2
+
3
+ const TEST_URL = "src/core/interval/interval.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
+ });
@@ -65,7 +65,7 @@ describe("urlUtils", () => {
65
65
 
66
66
  expectIsSameOrigin("path", true);
67
67
 
68
- const origin = urlResolve(document.location.href);
68
+ const origin = urlResolve(window.location.href);
69
69
  expectIsSameOrigin(`//${origin.host}/path`, true);
70
70
 
71
71
  // Different domain.
@@ -348,9 +348,12 @@ export function ngModelAriaDirective($aria) {
348
348
  }
349
349
 
350
350
  if (shouldAttachAttr("aria-invalid", "ariaInvalid", elem, true)) {
351
- scope.$watch("ngModel.$invalid", (newVal) => {
352
- elem.attr("aria-invalid", (!!newVal).toString());
353
- });
351
+ scope.$watch(
352
+ () => ngModel.$invalid,
353
+ (newVal) => {
354
+ elem.attr("aria-invalid", (!!newVal).toString());
355
+ },
356
+ );
354
357
  }
355
358
  },
356
359
  };