@angular-wave/angular.ts 0.0.66 → 0.0.67
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/animations/animate-js.js +4 -4
- package/src/animations/animate-swap.js +3 -0
- package/src/core/compile/compile.js +3 -3
- package/src/core/controller/controller.js +0 -5
- package/src/core/di/injector.js +9 -12
- package/src/core/di/internal-injector.js +113 -60
- package/src/core/parser/parse.js +1 -12
- package/src/core/parser/parse.spec.js +96 -110
- package/src/core/timeout/timeout.js +110 -111
- package/src/directive/input/input.js +32 -726
- package/src/directive/input/input.md +706 -0
- package/src/directive/select/select.js +48 -122
- package/src/directive/select/select.md +74 -0
- package/src/directive/show-hide/show-hide.js +13 -224
- package/src/directive/show-hide/show-hide.md +257 -0
- package/src/filters/limit-to.spec.js +1 -1
- package/src/filters/order-by.spec.js +1 -1
- package/src/index.js +6 -2
- package/src/loader.js +7 -3
- package/src/public.js +1 -7
- package/src/router/state/state-builder.js +2 -4
- package/src/router/state/state-service.js +1 -1
- package/src/router/state-provider.js +1 -1
- package/src/router/template-factory.js +10 -10
- package/src/router/url/url-service.js +4 -4
- package/src/services/anchor-scroll.js +2 -2
- package/src/services/browser.js +2 -9
- package/src/services/cache-factory.js +0 -67
- package/src/services/cache-factory.md +75 -0
- package/src/services/cookie-reader.js +36 -55
- package/src/services/http/http.js +62 -587
- package/src/services/http/http.md +413 -0
- package/src/services/http-backend/http-backend.js +19 -44
- package/src/services/template-request.js +1 -9
- package/src/shared/jqlite/jqlite.js +4 -69
- package/src/types.js +2 -4
- package/types/animations/animate-swap.d.ts +4 -7
- package/types/core/compile/compile.d.ts +6 -6
- package/types/core/controller/controller.d.ts +0 -5
- package/types/core/di/internal-injector.d.ts +73 -18
- package/types/core/exception-handler.d.ts +1 -1
- package/types/core/parser/parse.d.ts +1 -1
- package/types/core/timeout/timeout.d.ts +16 -26
- package/types/directive/input/input.d.ts +19 -124
- package/types/directive/select/select.d.ts +7 -74
- package/types/directive/show-hide/show-hide.d.ts +11 -224
- package/types/loader.d.ts +4 -4
- package/types/router/state/state-builder.d.ts +1 -2
- package/types/router/state/state-service.d.ts +2 -2
- package/types/router/state-provider.d.ts +2 -2
- package/types/router/template-factory.d.ts +15 -15
- package/types/router/url/url-service.d.ts +4 -4
- package/types/services/anchor-scroll.d.ts +1 -1
- package/types/services/browser.d.ts +0 -10
- package/types/services/cache-factory.d.ts +0 -67
- package/types/services/cookie-reader.d.ts +2 -10
- package/types/services/http/http.d.ts +53 -61
- package/types/services/http-backend/http-backend.d.ts +8 -31
- package/types/services/template-request.d.ts +1 -9
- package/types/shared/jqlite/jqlite.d.ts +9 -9
- package/types/types.d.ts +1 -9
|
@@ -1,67 +1,48 @@
|
|
|
1
1
|
import { isUndefined } from "../shared/utils";
|
|
2
2
|
|
|
3
|
+
let lastCookies = {};
|
|
4
|
+
let lastCookieString = "";
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @description
|
|
6
|
-
* This is a private service for reading cookies used by $http and ngCookies
|
|
7
|
-
*
|
|
8
|
-
* @return {Object} a key/value map of the current cookies
|
|
7
|
+
* @returns {Object<String, String>} List of all cookies
|
|
9
8
|
*/
|
|
10
|
-
export function
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return rawDocument.cookie || "";
|
|
18
|
-
} catch (e) {
|
|
19
|
-
return "";
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function safeDecodeURIComponent(str) {
|
|
24
|
-
try {
|
|
25
|
-
return decodeURIComponent(str);
|
|
26
|
-
} catch (e) {
|
|
27
|
-
return str;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return function () {
|
|
32
|
-
let cookieArray;
|
|
33
|
-
let cookie;
|
|
34
|
-
let i;
|
|
35
|
-
let index;
|
|
36
|
-
let name;
|
|
37
|
-
const currentCookieString = safeGetCookie(rawDocument);
|
|
9
|
+
export function getCookies() {
|
|
10
|
+
let cookieArray;
|
|
11
|
+
let cookie;
|
|
12
|
+
let i;
|
|
13
|
+
let index;
|
|
14
|
+
let name;
|
|
15
|
+
const currentCookieString = window.document.cookie;
|
|
38
16
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
17
|
+
if (currentCookieString !== lastCookieString) {
|
|
18
|
+
lastCookieString = currentCookieString;
|
|
19
|
+
cookieArray = lastCookieString.split("; ");
|
|
20
|
+
lastCookies = {};
|
|
43
21
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
22
|
+
for (i = 0; i < cookieArray.length; i++) {
|
|
23
|
+
cookie = cookieArray[i];
|
|
24
|
+
index = cookie.indexOf("=");
|
|
25
|
+
if (index > 0) {
|
|
26
|
+
// ignore nameless cookies
|
|
27
|
+
name = safeDecodeURIComponent(cookie.substring(0, index));
|
|
28
|
+
// the first value that is seen for a cookie is the most
|
|
29
|
+
// specific one. values for the same cookie name that
|
|
30
|
+
// follow are for less specific paths.
|
|
31
|
+
if (isUndefined(lastCookies[name])) {
|
|
32
|
+
lastCookies[name] = safeDecodeURIComponent(
|
|
33
|
+
cookie.substring(index + 1),
|
|
34
|
+
);
|
|
58
35
|
}
|
|
59
36
|
}
|
|
60
37
|
}
|
|
61
|
-
|
|
62
|
-
|
|
38
|
+
}
|
|
39
|
+
return lastCookies;
|
|
63
40
|
}
|
|
64
41
|
|
|
65
|
-
|
|
66
|
-
|
|
42
|
+
function safeDecodeURIComponent(str) {
|
|
43
|
+
try {
|
|
44
|
+
return decodeURIComponent(str);
|
|
45
|
+
} catch (e) {
|
|
46
|
+
return str;
|
|
47
|
+
}
|
|
67
48
|
}
|