@angular-wave/angular.ts 0.0.67 → 0.0.68
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/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/core/interval/interval-factory.js +8 -1
- package/src/core/interval/interval.js +30 -16
- package/src/core/location/location.js +473 -626
- package/src/core/location/location.md +114 -0
- package/src/core/location/location.spec.js +1 -76
- package/src/core/q/q.js +63 -65
- package/src/core/sce/sce.js +1 -3
- package/src/core/scope/scope.js +2 -5
- package/src/core/url-utils/url-utils.js +5 -0
- package/src/directive/options/options.js +2 -156
- package/src/directive/options/options.md +179 -0
- package/src/directive/select/select.js +7 -4
- package/src/exts/messages/messages.js +2 -0
- package/src/router/params/param.js +54 -54
- package/src/router/path/path-utils.js +1 -0
- package/src/router/url/url-service.js +7 -0
- package/src/services/anchor-scroll.js +2 -4
- package/src/shared/jqlite/jqlite.js +1 -1
- package/types/core/interval/interval-factory.d.ts +1 -1
- package/types/core/interval/interval.d.ts +4 -0
- package/types/core/location/location.d.ts +235 -166
- package/types/core/q/q.d.ts +61 -40
- package/types/core/scope/scope.d.ts +5 -8
- package/types/core/url-utils/url-utils.d.ts +4 -0
- package/types/router/params/param.d.ts +11 -0
- package/types/router/url/url-service.d.ts +9 -9
- package/types/services/anchor-scroll.d.ts +1 -1
- package/types/shared/jqlite/jqlite.d.ts +2 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@angular-wave/angular.ts",
|
|
3
3
|
"description": "A modern, optimized and typesafe version of AngularJS",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.68",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/angular-ts.esm.js",
|
|
8
8
|
"browser": "dist/angular-ts.umd.js",
|
|
@@ -6,7 +6,14 @@ export function $$IntervalFactoryProvider() {
|
|
|
6
6
|
"$q",
|
|
7
7
|
"$$q",
|
|
8
8
|
"$rootScope",
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {import('../../services/browser').Browser} $browser
|
|
12
|
+
* @param {*} $q
|
|
13
|
+
* @param {*} $$q
|
|
14
|
+
* @param {import('../scope/scope').Scope} $rootScope
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
10
17
|
function ($browser, $q, $$q, $rootScope) {
|
|
11
18
|
return function intervalFactory(setIntervalFn, clearIntervalFn) {
|
|
12
19
|
return function intervalFn(fn, delay, count, invokeApply) {
|
|
@@ -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
|
-
|
|
12
|
-
|
|
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
|
|
29
|
+
intervals.set(id, deferred);
|
|
15
30
|
return id;
|
|
16
|
-
}
|
|
17
|
-
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**s
|
|
34
|
+
* @param {IntervalId} id
|
|
35
|
+
*/
|
|
36
|
+
function clearIntervalFn(id) {
|
|
18
37
|
window.clearInterval(id);
|
|
19
|
-
delete
|
|
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 {
|
|
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
|
|
64
|
+
const deferred = intervals.get(id);
|
|
51
65
|
|
|
52
66
|
// Interval cancels should not report an unhandled promise.
|
|
53
67
|
markQExceptionHandled(deferred.promise);
|