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