@angular-wave/angular.ts 0.4.3 → 0.4.4

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 (128) hide show
  1. package/dist/angular-ts.umd.js +10 -0
  2. package/index.html +74 -3
  3. package/package.json +1 -1
  4. package/src/angular.spec.js +0 -5
  5. package/src/animations/animate-css.js +5 -13
  6. package/src/animations/animate-queue.js +22 -21
  7. package/src/animations/animate-runner.js +4 -8
  8. package/src/animations/animate.md +1 -1
  9. package/src/animations/animate.spec.js +0 -21
  10. package/src/animations/animation.js +1 -1
  11. package/src/binding.spec.js +0 -1
  12. package/src/core/cache/cache.js +2 -29
  13. package/src/core/compile/compile.js +26 -27
  14. package/src/core/compile/compile.spec.js +17 -266
  15. package/src/core/compile/compile.test.js +1 -1
  16. package/src/core/controller/controller.js +2 -0
  17. package/src/core/di/injector.md +1 -1
  18. package/src/core/di/injector.spec.js +0 -2
  19. package/src/core/di/internal-injector.js +2 -1
  20. package/src/core/interpolate/interpolate.js +16 -3
  21. package/src/core/interpolate/interpolate.spec.js +70 -16
  22. package/src/core/interval/interval.test.js +1 -1
  23. package/src/core/location/location.js +0 -2
  24. package/src/core/location/location.spec.js +27 -27
  25. package/src/core/{scope/scope.html → model/model.html} +1 -1
  26. package/src/core/model/model.js +944 -0
  27. package/src/core/model/model.spec.js +3012 -0
  28. package/src/core/on.spec.js +0 -7
  29. package/src/core/parse/interpreter.js +10 -7
  30. package/src/core/parse/parse.js +26 -5
  31. package/src/core/parse/parse.spec.js +95 -91
  32. package/src/core/prop.spec.js +4 -60
  33. package/src/core/sce/sce.spec.js +0 -8
  34. package/src/core/scope/scope.js +61 -30
  35. package/src/core/scope/scope.spec.js +25 -1960
  36. package/src/directive/aria/aria.js +3 -6
  37. package/src/directive/aria/aria.spec.js +0 -87
  38. package/src/directive/attrs/attrs.spec.js +0 -5
  39. package/src/directive/attrs/boolean.spec.js +0 -15
  40. package/src/directive/attrs/element-style.spec.js +0 -8
  41. package/src/directive/attrs/src.spec.js +0 -7
  42. package/src/directive/bind/bind.spec.js +0 -33
  43. package/src/directive/bind/bing-html.spec.js +0 -3
  44. package/src/{core/q/q.html → directive/channel/channel.html} +1 -1
  45. package/src/directive/channel/channel.js +29 -0
  46. package/src/directive/channel/channel.spec.js +52 -0
  47. package/src/directive/{list/list.test.js → channel/channel.test.js} +2 -4
  48. package/src/directive/class/class.js +3 -3
  49. package/src/directive/class/class.spec.js +9 -75
  50. package/src/directive/controller/controller.spec.js +0 -13
  51. package/src/directive/events/click.spec.js +0 -3
  52. package/src/directive/events/event.spec.js +0 -6
  53. package/src/directive/form/form.js +2 -3
  54. package/src/directive/form/form.spec.js +0 -65
  55. package/src/directive/if/if.spec.js +0 -4
  56. package/src/directive/include/include.spec.js +8 -59
  57. package/src/directive/init/init.js +6 -2
  58. package/src/directive/init/init.spec.js +0 -2
  59. package/src/directive/input/input.spec.js +0 -136
  60. package/src/directive/messages/messages.spec.js +4 -35
  61. package/src/directive/model/model.js +18 -25
  62. package/src/directive/model/model.spec.js +2 -49
  63. package/src/directive/model-options/model-options.spec.js +0 -6
  64. package/src/directive/non-bindable/non-bindable.spec.js +0 -1
  65. package/src/directive/observe/observe.js +0 -1
  66. package/src/directive/observe/observe.spec.js +0 -1
  67. package/src/directive/options/options.spec.js +0 -34
  68. package/src/directive/ref/href.spec.js +0 -15
  69. package/src/directive/repeat/repeat.spec.js +8 -135
  70. package/src/directive/script/script.spec.js +0 -2
  71. package/src/directive/select/select.js +3 -3
  72. package/src/directive/select/select.spec.js +0 -96
  73. package/src/directive/show-hide/show-hide.js +2 -2
  74. package/src/directive/show-hide/show-hide.spec.js +8 -19
  75. package/src/directive/style/style.spec.js +0 -7
  76. package/src/directive/switch/switch.spec.js +5 -5
  77. package/src/directive/validators/validators.spec.js +0 -1
  78. package/src/loader.js +0 -1
  79. package/src/public.js +75 -80
  80. package/src/router/common/coreservices.js +0 -2
  81. package/src/router/directives/state-directives.js +6 -14
  82. package/src/router/directives/state-directives.spec.js +0 -83
  83. package/src/router/directives/view-directive.js +4 -13
  84. package/src/router/directives/view-directive.spec.js +25 -71
  85. package/src/router/hooks/lazy-load.js +2 -2
  86. package/src/router/hooks/views.js +3 -5
  87. package/src/router/resolve/resolvable.js +3 -6
  88. package/src/router/resolve/resolve-context.js +2 -2
  89. package/src/router/state/state-service.js +4 -4
  90. package/src/router/state/state.spec.js +2 -5
  91. package/src/router/state/views.js +7 -10
  92. package/src/router/template-factory.js +3 -6
  93. package/src/router/template-factory.spec.js +0 -4
  94. package/src/router/transition/transition-hook.js +1 -1
  95. package/src/router/transition/transition.js +1 -1
  96. package/src/router/view-hook.spec.js +2 -2
  97. package/src/router/view-scroll.js +4 -6
  98. package/src/services/http/http.js +6 -9
  99. package/src/services/http/http.spec.js +30 -31
  100. package/src/services/http/template-request.spec.js +0 -10
  101. package/src/services/http-backend/http-backend.spec.js +3 -3
  102. package/src/services/template-request.js +2 -4
  103. package/src/shared/common.js +1 -2
  104. package/src/shared/jqlite/jqlite.js +0 -3
  105. package/types/core/cache/cache.d.ts +1 -1
  106. package/types/core/model/model.d.ts +204 -0
  107. package/types/core/parse/parse.d.ts +26 -0
  108. package/types/core/scope/scope.d.ts +22 -21
  109. package/types/directive/channel/channel.d.ts +11 -0
  110. package/src/core/interval/interval-factory.js +0 -50
  111. package/src/core/interval/interval.html +0 -18
  112. package/src/core/interval/interval.js +0 -77
  113. package/src/core/interval/interval.md +0 -123
  114. package/src/core/interval/interval.spec.js +0 -280
  115. package/src/core/q/q.js +0 -472
  116. package/src/core/q/q.md +0 -211
  117. package/src/core/q/q.spec.js +0 -2748
  118. package/src/core/q/q.test.js +0 -12
  119. package/src/core/scope/scope.test.js +0 -12
  120. package/src/core/timeout/timeout.html +0 -18
  121. package/src/core/timeout/timeout.js +0 -109
  122. package/src/core/timeout/timeout.spec.js +0 -354
  123. package/src/core/timeout/timout.test.js +0 -12
  124. package/src/directive/list/list.html +0 -18
  125. package/src/directive/list/list.js +0 -46
  126. package/src/directive/list/list.md +0 -22
  127. package/src/directive/list/list.spec.js +0 -172
  128. package/types/directive/list/list.d.ts +0 -4
@@ -1,172 +0,0 @@
1
- import { dealoc } from "../../shared/jqlite/jqlite";
2
- import { Angular } from "../../loader";
3
-
4
- describe("ngList", () => {
5
- let $rootScope;
6
- let element;
7
- let $compile;
8
- let injector;
9
- let inputElm;
10
-
11
- beforeEach(() => {
12
- window.angular = new Angular();
13
- window.angular.module("test", []);
14
- injector = window.angular.bootstrap(document.getElementById("dummy"), [
15
- "test",
16
- ]);
17
- $compile = injector.get("$compile");
18
- $rootScope = injector.get("$rootScope");
19
- });
20
-
21
- afterEach(() => {
22
- dealoc(element);
23
- });
24
-
25
- function changeInputValue(val) {
26
- inputElm[0].value = val;
27
- inputElm[0].dispatchEvent(new Event("change"));
28
- }
29
-
30
- it("should parse text into an array", () => {
31
- inputElm = $compile('<input type="text" ng-model="list" ng-list />')(
32
- $rootScope,
33
- );
34
-
35
- // model -> view
36
- $rootScope.$apply("list = ['x', 'y', 'z']");
37
- expect(inputElm.val()).toBe("x, y, z");
38
-
39
- // view -> model
40
- changeInputValue("1, 2, 3");
41
- expect($rootScope.list).toEqual(["1", "2", "3"]);
42
- });
43
-
44
- it("should not clobber text if model changes due to itself", () => {
45
- // When the user types 'a,b' the 'a,' stage parses to ['a'] but if the
46
- // $parseModel function runs it will change to 'a', in essence preventing
47
- // the user from ever typing ','.
48
- inputElm = $compile('<input type="text" ng-model="list" ng-list />')(
49
- $rootScope,
50
- );
51
-
52
- changeInputValue("a ");
53
- expect(inputElm.val()).toEqual("a ");
54
- expect($rootScope.list).toEqual(["a"]);
55
-
56
- changeInputValue("a ,");
57
- expect(inputElm.val()).toEqual("a ,");
58
- expect($rootScope.list).toEqual(["a"]);
59
-
60
- changeInputValue("a , ");
61
- expect(inputElm.val()).toEqual("a , ");
62
- expect($rootScope.list).toEqual(["a"]);
63
-
64
- changeInputValue("a , b");
65
- expect(inputElm.val()).toEqual("a , b");
66
- expect($rootScope.list).toEqual(["a", "b"]);
67
- });
68
-
69
- it("should convert empty string to an empty array", () => {
70
- inputElm = $compile('<input type="text" ng-model="list" ng-list />')(
71
- $rootScope,
72
- );
73
-
74
- changeInputValue("");
75
- expect($rootScope.list).toEqual([]);
76
- });
77
-
78
- it("should be invalid if required and empty", () => {
79
- inputElm = $compile('<input type="text" ng-list ng-model="list" required>')(
80
- $rootScope,
81
- );
82
- changeInputValue("");
83
- expect($rootScope.list).toBeUndefined();
84
- expect(inputElm[0].classList.contains("ng-invalid")).toBeTrue();
85
- changeInputValue("a,b");
86
- expect($rootScope.list).toEqual(["a", "b"]);
87
- expect(inputElm[0].classList.contains("ng-valid")).toBeTrue();
88
- });
89
-
90
- describe("with a custom separator", () => {
91
- it("should split on the custom separator", () => {
92
- inputElm = $compile('<input type="text" ng-model="list" ng-list=":" />')(
93
- $rootScope,
94
- );
95
-
96
- changeInputValue("a,a");
97
- expect($rootScope.list).toEqual(["a,a"]);
98
-
99
- changeInputValue("a:b");
100
- expect($rootScope.list).toEqual(["a", "b"]);
101
- });
102
-
103
- it("should join the list back together with the custom separator", () => {
104
- inputElm = $compile(
105
- '<input type="text" ng-model="list" ng-list=" : " />',
106
- )($rootScope);
107
-
108
- $rootScope.$apply(() => {
109
- $rootScope.list = ["x", "y", "z"];
110
- });
111
- expect(inputElm.val()).toBe("x : y : z");
112
- });
113
- });
114
-
115
- describe("(with ngTrim undefined or true)", () => {
116
- it("should ignore separator whitespace when splitting", () => {
117
- inputElm = $compile(
118
- '<input type="text" ng-model="list" ng-list=" | " />',
119
- )($rootScope);
120
-
121
- changeInputValue("a|b");
122
- expect($rootScope.list).toEqual(["a", "b"]);
123
- });
124
-
125
- it("should trim whitespace from each list item", () => {
126
- inputElm = $compile('<input type="text" ng-model="list" ng-list="|" />')(
127
- $rootScope,
128
- );
129
-
130
- changeInputValue("a | b");
131
- expect($rootScope.list).toEqual(["a", "b"]);
132
- });
133
- });
134
-
135
- describe("(with ngTrim set to false)", () => {
136
- it("should use separator whitespace when splitting", () => {
137
- inputElm = $compile(
138
- '<input type="text" ng-model="list" ng-trim="false" ng-list=" | " />',
139
- )($rootScope);
140
-
141
- changeInputValue("a|b");
142
- expect($rootScope.list).toEqual(["a|b"]);
143
-
144
- changeInputValue("a | b");
145
- expect($rootScope.list).toEqual(["a", "b"]);
146
- });
147
-
148
- it("should not trim whitespace from each list item", () => {
149
- inputElm = $compile(
150
- '<input type="text" ng-model="list" ng-trim="false" ng-list="|" />',
151
- )($rootScope);
152
- changeInputValue("a | b");
153
- expect($rootScope.list).toEqual(["a ", " b"]);
154
- });
155
-
156
- it("should support splitting on newlines", () => {
157
- inputElm = $compile(
158
- '<textarea type="text" ng-model="list" ng-trim="false" ng-list="&#10;"></textarea>',
159
- )($rootScope);
160
- changeInputValue("a\nb");
161
- expect($rootScope.list).toEqual(["a", "b"]);
162
- });
163
-
164
- it("should support splitting on whitespace", () => {
165
- inputElm = $compile(
166
- '<textarea type="text" ng-model="list" ng-trim="false" ng-list=" "></textarea>',
167
- )($rootScope);
168
- changeInputValue("a b");
169
- expect($rootScope.list).toEqual(["a", "b"]);
170
- });
171
- });
172
- });
@@ -1,4 +0,0 @@
1
- /**
2
- * @returns {import('../../types').Directive}
3
- */
4
- export function ngListDirective(): import("../../types").Directive;