@angular-wave/angular.ts 0.0.65 → 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 (79) 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 +6 -0
  5. package/src/animations/animate-swap.js +3 -0
  6. package/src/animations/animation.js +1 -1
  7. package/src/core/compile/compile.js +16 -4
  8. package/src/core/controller/controller.js +5 -5
  9. package/src/core/di/injector.js +133 -259
  10. package/src/core/di/injector.md +3 -3
  11. package/src/core/di/injector.spec.js +30 -24
  12. package/src/core/di/internal-injector.js +286 -0
  13. package/src/core/filter/filter.js +5 -0
  14. package/src/core/parser/parse.js +1 -12
  15. package/src/core/parser/parse.spec.js +96 -110
  16. package/src/core/sce/sce.js +6 -1
  17. package/src/core/timeout/timeout.js +110 -111
  18. package/src/directive/input/input.js +32 -726
  19. package/src/directive/input/input.md +706 -0
  20. package/src/directive/select/select.js +48 -122
  21. package/src/directive/select/select.md +74 -0
  22. package/src/directive/show-hide/show-hide.js +13 -224
  23. package/src/directive/show-hide/show-hide.md +257 -0
  24. package/src/filters/limit-to.spec.js +1 -1
  25. package/src/filters/order-by.spec.js +1 -1
  26. package/src/index.js +6 -2
  27. package/src/loader.js +8 -4
  28. package/src/public.js +1 -7
  29. package/src/router/services.js +9 -4
  30. package/src/router/state/state-builder.js +6 -7
  31. package/src/router/state/state-registry.js +5 -0
  32. package/src/router/state/state-service.js +1 -1
  33. package/src/router/state/views.js +2 -1
  34. package/src/router/state-provider.js +1 -1
  35. package/src/router/template-factory.js +15 -14
  36. package/src/router/url/url-service.js +4 -4
  37. package/src/services/anchor-scroll.js +2 -2
  38. package/src/services/browser.js +2 -9
  39. package/src/services/cache-factory.js +0 -67
  40. package/src/services/cache-factory.md +75 -0
  41. package/src/services/cookie-reader.js +36 -55
  42. package/src/services/http/http.js +73 -586
  43. package/src/services/http/http.md +413 -0
  44. package/src/services/http-backend/http-backend.js +19 -44
  45. package/src/services/template-request.js +1 -9
  46. package/src/shared/jqlite/jqlite.js +4 -69
  47. package/src/types.js +8 -12
  48. package/types/animations/animate-js.d.ts +1 -1
  49. package/types/animations/animate-swap.d.ts +4 -7
  50. package/types/animations/animation.d.ts +1 -1
  51. package/types/core/compile/compile.d.ts +7 -7
  52. package/types/core/controller/controller.d.ts +1 -6
  53. package/types/core/di/injector.d.ts +13 -7
  54. package/types/core/di/internal-injector.d.ts +91 -0
  55. package/types/core/exception-handler.d.ts +1 -1
  56. package/types/core/filter/filter.d.ts +1 -1
  57. package/types/core/parser/parse.d.ts +1 -1
  58. package/types/core/sce/sce.d.ts +1 -1
  59. package/types/core/timeout/timeout.d.ts +16 -26
  60. package/types/directive/input/input.d.ts +19 -124
  61. package/types/directive/select/select.d.ts +7 -74
  62. package/types/directive/show-hide/show-hide.d.ts +11 -224
  63. package/types/loader.d.ts +4 -4
  64. package/types/router/services.d.ts +8 -1
  65. package/types/router/state/state-builder.d.ts +1 -2
  66. package/types/router/state/state-registry.d.ts +2 -2
  67. package/types/router/state/state-service.d.ts +2 -2
  68. package/types/router/state-provider.d.ts +2 -2
  69. package/types/router/template-factory.d.ts +16 -16
  70. package/types/router/url/url-service.d.ts +4 -4
  71. package/types/services/anchor-scroll.d.ts +1 -1
  72. package/types/services/browser.d.ts +0 -10
  73. package/types/services/cache-factory.d.ts +0 -67
  74. package/types/services/cookie-reader.d.ts +2 -10
  75. package/types/services/http/http.d.ts +53 -61
  76. package/types/services/http-backend/http-backend.d.ts +8 -31
  77. package/types/services/template-request.d.ts +1 -9
  78. package/types/shared/jqlite/jqlite.d.ts +9 -9
  79. package/types/types.d.ts +5 -38
@@ -1,72 +1,5 @@
1
1
  import { extend, forEach, isUndefined, minErr } from "../shared/utils";
2
2
 
3
- /**
4
- * @ngdoc service
5
- * @name $cacheFactory
6
- *
7
- *
8
- * @description
9
- * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to
10
- * them.
11
- *
12
- * ```js
13
- *
14
- * let cache = $cacheFactory('cacheId');
15
- * expect($cacheFactory.get('cacheId')).toBe(cache);
16
- * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
17
- *
18
- * cache.put("key", "value");
19
- * cache.put("another key", "another value");
20
- *
21
- * // We've specified no options on creation
22
- * expect(cache.info()).toEqual({id: 'cacheId', size: 2});
23
- *
24
- * ```
25
- *
26
- *
27
- * @example
28
- <example module="cacheExampleApp" name="cache-factory">
29
- <file name="index.html">
30
- <div ng-controller="CacheController">
31
- <input ng-model="newCacheKey" placeholder="Key">
32
- <input ng-model="newCacheValue" placeholder="Value">
33
- <button ng-click="put(newCacheKey, newCacheValue)">Cache</button>
34
-
35
- <p ng-if="keys.length">Cached Values</p>
36
- <div ng-repeat="key in keys">
37
- <span ng-bind="key"></span>
38
- <span>: </span>
39
- <b ng-bind="cache.get(key)"></b>
40
- </div>
41
-
42
- <p>Cache Info</p>
43
- <div ng-repeat="(key, value) in cache.info()">
44
- <span ng-bind="key"></span>
45
- <span>: </span>
46
- <b ng-bind="value"></b>
47
- </div>
48
- </div>
49
- </file>
50
- <file name="script.js">
51
- angular.module('cacheExampleApp', []).
52
- controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {
53
- $scope.keys = [];
54
- $scope.cache = $cacheFactory('cacheId');
55
- $scope.put = function(key, value) {
56
- if (angular.isUndefined($scope.cache.get(key))) {
57
- $scope.keys.push(key);
58
- }
59
- $scope.cache.put(key, angular.isUndefined(value) ? null : value);
60
- };
61
- }]);
62
- </file>
63
- <file name="style.css">
64
- p {
65
- margin: 10px 0 3px;
66
- }
67
- </file>
68
- </example>
69
- */
70
3
  export function CacheFactoryProvider() {
71
4
  this.$get = function () {
72
5
  const caches = {};
@@ -0,0 +1,75 @@
1
+ /\*\*
2
+
3
+ - @ngdoc service
4
+ - @name $cacheFactory
5
+ -
6
+ -
7
+ - @description
8
+ - Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to
9
+ - them.
10
+ -
11
+ - ```js
12
+
13
+ ```
14
+
15
+ -
16
+ - let cache = $cacheFactory('cacheId');
17
+ - expect($cacheFactory.get('cacheId')).toBe(cache);
18
+ - expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
19
+ -
20
+ - cache.put("key", "value");
21
+ - cache.put("another key", "another value");
22
+ -
23
+ - // We've specified no options on creation
24
+ - expect(cache.info()).toEqual({id: 'cacheId', size: 2});
25
+ -
26
+ - ```
27
+
28
+ ```
29
+
30
+ -
31
+ -
32
+ - @example
33
+ <example module="cacheExampleApp" name="cache-factory">
34
+ <file name="index.html">
35
+ <div ng-controller="CacheController">
36
+ <input ng-model="newCacheKey" placeholder="Key">
37
+ <input ng-model="newCacheValue" placeholder="Value">
38
+ <button ng-click="put(newCacheKey, newCacheValue)">Cache</button>
39
+
40
+ <p ng-if="keys.length">Cached Values</p>
41
+ <div ng-repeat="key in keys">
42
+ <span ng-bind="key"></span>
43
+ <span>: </span>
44
+ <b ng-bind="cache.get(key)"></b>
45
+ </div>
46
+
47
+ <p>Cache Info</p>
48
+ <div ng-repeat="(key, value) in cache.info()">
49
+ <span ng-bind="key"></span>
50
+ <span>: </span>
51
+ <b ng-bind="value"></b>
52
+ </div>
53
+ </div>
54
+ </file>
55
+ <file name="script.js">
56
+ angular.module('cacheExampleApp', []).
57
+ controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {
58
+ $scope.keys = [];
59
+ $scope.cache = $cacheFactory('cacheId');
60
+ $scope.put = function(key, value) {
61
+ if (angular.isUndefined($scope.cache.get(key))) {
62
+ $scope.keys.push(key);
63
+ }
64
+ $scope.cache.put(key, angular.isUndefined(value) ? null : value);
65
+ };
66
+ }]);
67
+ </file>
68
+ <file name="style.css">
69
+ p {
70
+ margin: 10px 0 3px;
71
+ }
72
+ </file>
73
+
74
+ </example>
75
+ */
@@ -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
  }