@angular-wave/angular.ts 0.0.67 → 0.0.69

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 (87) hide show
  1. package/dist/angular-ts.esm.js +2 -2
  2. package/dist/angular-ts.umd.js +2 -2
  3. package/package.json +1 -1
  4. package/src/animations/animate-swap.js +1 -1
  5. package/src/core/animate/animate.js +5 -5
  6. package/src/core/compile/compile.spec.js +2 -2
  7. package/src/core/controller/controller.js +5 -1
  8. package/src/core/cookie-reader.spec.js +1 -1
  9. package/src/core/di/injector.js +1 -1
  10. package/src/core/di/injector.spec.js +35 -35
  11. package/src/core/di/internal-injector.js +1 -1
  12. package/src/core/filter/filter.spec.js +15 -15
  13. package/src/core/interpolate/interpolate.spec.js +29 -29
  14. package/src/core/interval/interval-factory.js +8 -1
  15. package/src/core/interval/interval.js +30 -16
  16. package/src/core/interval/interval.spec.js +1 -1
  17. package/src/core/location/location.js +473 -626
  18. package/src/core/location/location.md +114 -0
  19. package/src/core/location/location.spec.js +2 -77
  20. package/src/core/parser/lexer.spec.js +1 -1
  21. package/src/core/parser/parse.spec.js +1 -1
  22. package/src/core/q/q.js +64 -65
  23. package/src/core/q/q.spec.js +1 -1
  24. package/src/core/sce/sce.js +1 -3
  25. package/src/core/scope/scope.js +3 -6
  26. package/src/core/timeout/timeout.js +5 -21
  27. package/src/core/url-utils/url-utils.js +5 -0
  28. package/src/directive/attrs/boolean.spec.js +1 -1
  29. package/src/directive/bind/bind.js +2 -2
  30. package/src/directive/class/class.js +1 -1
  31. package/src/directive/form/form.js +1 -18
  32. package/src/directive/form/form.spec.js +2 -2
  33. package/src/directive/include/include.js +7 -0
  34. package/src/directive/input/input.js +1 -1
  35. package/src/{exts → directive}/messages/messages.html +4 -1
  36. package/src/directive/messages/messages.js +346 -0
  37. package/src/{exts → directive}/messages/messages.spec.js +7 -11
  38. package/src/{exts → directive}/messages/messages.test.js +1 -1
  39. package/src/directive/model-options/model-options.spec.js +1 -1
  40. package/src/directive/options/options.js +2 -156
  41. package/src/directive/options/options.md +179 -0
  42. package/src/directive/select/select.js +7 -4
  43. package/src/directive/switch/switch.spec.js +1 -1
  44. package/src/exts/aria/aria.spec.js +1 -1
  45. package/src/filters/filter.js +2 -3
  46. package/src/filters/filter.spec.js +1 -1
  47. package/src/filters/filters.spec.js +1 -1
  48. package/src/filters/limit-to.spec.js +2 -2
  49. package/src/loader.js +1 -1
  50. package/src/loader.spec.js +1 -1
  51. package/src/public.js +12 -2
  52. package/src/router/common/glob.spec.js +1 -1
  53. package/src/router/params/param-factory.js +1 -1
  54. package/src/router/params/param.js +54 -54
  55. package/src/router/path/path-utils.js +1 -0
  56. package/src/router/state/state-builder.spec.js +1 -1
  57. package/src/router/template-factory.js +6 -4
  58. package/src/router/url/url-service.js +7 -0
  59. package/src/router/view/view.spec.js +8 -11
  60. package/src/router/view-scroll.js +6 -1
  61. package/src/services/anchor-scroll.html +83 -0
  62. package/src/services/anchor-scroll.js +25 -10
  63. package/src/services/browser.js +1 -1
  64. package/src/services/http/http.spec.js +40 -40
  65. package/src/shared/jqlite/jqlite.js +4 -4
  66. package/src/shared/jqlite/jqlite.spec.js +4 -4
  67. package/src/shared/utils.js +1 -1
  68. package/types/core/interval/interval-factory.d.ts +1 -1
  69. package/types/core/interval/interval.d.ts +4 -0
  70. package/types/core/location/location.d.ts +235 -166
  71. package/types/core/q/q.d.ts +66 -40
  72. package/types/core/scope/scope.d.ts +5 -8
  73. package/types/core/timeout/timeout.d.ts +3 -7
  74. package/types/core/url-utils/url-utils.d.ts +4 -0
  75. package/types/directive/form/form.d.ts +3 -20
  76. package/types/directive/include/include.d.ts +1 -1
  77. package/types/router/params/param-factory.d.ts +1 -1
  78. package/types/router/params/param.d.ts +11 -0
  79. package/types/router/template-factory.d.ts +4 -4
  80. package/types/router/url/url-service.d.ts +9 -9
  81. package/types/router/view-scroll.d.ts +1 -1
  82. package/types/services/anchor-scroll.d.ts +16 -1
  83. package/types/services/browser.d.ts +2 -2
  84. package/types/shared/jqlite/jqlite.d.ts +2 -2
  85. package/src/exts/messages/messages.js +0 -359
  86. package/types/exts/messages/messages.d.ts +0 -1
  87. /package/src/{exts → directive}/messages/messages.md +0 -0
@@ -3,32 +3,47 @@ import { minErr } from "../../shared/utils";
3
3
 
4
4
  const $intervalMinErr = minErr("$interval");
5
5
 
6
+ /**
7
+ * @typedef {number} IntervalId
8
+ * Interval ID which uniquely identifies the interval and can be used to cancel it
9
+ */
10
+
11
+ /**
12
+ * @type {Map<IntervalId, import("../q/q").Deferred<any>>}
13
+ */
14
+ const intervals = new Map();
15
+
6
16
  export function $IntervalProvider() {
7
17
  this.$get = [
8
18
  "$$intervalFactory",
9
19
  // TODO Add type
10
20
  function ($$intervalFactory) {
11
- const intervals = {};
12
- const setIntervalFn = function (tick, delay, deferred) {
21
+ /**
22
+ * @param {TimerHandler} tick
23
+ * @param {number} delay
24
+ * @param {import("../q/q").Deferred<any>} deferred
25
+ * @returns {IntervalId} - This method returns an interval ID which uniquely identifies the interval
26
+ */
27
+ function setIntervalFn(tick, delay, deferred) {
13
28
  const id = window.setInterval(tick, delay);
14
- intervals[id] = deferred;
29
+ intervals.set(id, deferred);
15
30
  return id;
16
- };
17
- const clearIntervalFn = function (id) {
31
+ }
32
+
33
+ /**s
34
+ * @param {IntervalId} id
35
+ */
36
+ function clearIntervalFn(id) {
18
37
  window.clearInterval(id);
19
- delete intervals[id];
20
- };
38
+ intervals.delete(id);
39
+ }
21
40
 
22
41
  const interval = $$intervalFactory(setIntervalFn, clearIntervalFn);
23
42
 
24
43
  /**
25
- * @ngdoc method
26
- * @name $interval#cancel
27
- *
28
- * @description
29
44
  * Cancels a task associated with the `promise`.
30
45
  *
31
- * @param {Promise=} promise returned by the `$interval` function.
46
+ * @param {!import("../q/q").QPromise<any>} promise returned by the `$interval` function.
32
47
  * @returns {boolean} Returns `true` if the task was successfully canceled.
33
48
  */
34
49
  interval.cancel = function (promise) {
@@ -41,13 +56,12 @@ export function $IntervalProvider() {
41
56
  );
42
57
  }
43
58
 
44
- if (
45
- !Object.prototype.hasOwnProperty.call(intervals, promise.$$intervalId)
46
- )
59
+ if (!intervals.has(promise.$$intervalId)) {
47
60
  return false;
61
+ }
48
62
 
49
63
  const id = promise.$$intervalId;
50
- const deferred = intervals[id];
64
+ const deferred = intervals.get(id);
51
65
 
52
66
  // Interval cancels should not report an unhandled promise.
53
67
  markQExceptionHandled(deferred.promise);
@@ -1,5 +1,5 @@
1
1
  import { Angular } from "../../loader";
2
- import { createInjector } from "../../core/di/injector";
2
+ import { createInjector } from "../di/injector";
3
3
  import { wait } from "../../shared/test-utils";
4
4
 
5
5
  describe("$interval", () => {