@angular-wave/angular.ts 0.4.2 → 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 (150) hide show
  1. package/dist/angular-ts.esm.js +2 -2
  2. package/dist/angular-ts.umd.js +12 -2
  3. package/index.html +74 -3
  4. package/package.json +7 -7
  5. package/src/angular.spec.js +1 -269
  6. package/src/animations/animate-css-driver.js +2 -2
  7. package/src/animations/animate-css.js +12 -21
  8. package/src/animations/animate-js-driver.js +1 -3
  9. package/src/animations/animate-js.js +4 -4
  10. package/src/animations/animate-queue.js +23 -23
  11. package/src/animations/animate-runner.js +4 -8
  12. package/src/animations/animate.md +1 -1
  13. package/src/animations/animate.spec.js +0 -21
  14. package/src/animations/animation.js +4 -4
  15. package/src/animations/shared.js +14 -12
  16. package/src/binding.spec.js +0 -1
  17. package/src/core/cache/cache.js +2 -29
  18. package/src/core/compile/attributes.js +2 -3
  19. package/src/core/compile/compile.js +260 -245
  20. package/src/core/compile/compile.spec.js +63 -317
  21. package/src/core/compile/compile.test.js +1 -1
  22. package/src/core/controller/controller.js +2 -0
  23. package/src/core/di/injector.md +1 -1
  24. package/src/core/di/injector.spec.js +0 -2
  25. package/src/core/di/internal-injector.js +2 -1
  26. package/src/core/interpolate/interpolate.js +16 -3
  27. package/src/core/interpolate/interpolate.spec.js +70 -16
  28. package/src/core/location/location.js +0 -2
  29. package/src/core/location/location.spec.js +27 -27
  30. package/src/core/{scope/scope.html → model/model.html} +1 -1
  31. package/src/core/model/model.js +944 -0
  32. package/src/core/model/model.spec.js +3012 -0
  33. package/src/core/on.spec.js +0 -7
  34. package/src/core/parse/interpreter.js +10 -7
  35. package/src/core/parse/parse.js +28 -7
  36. package/src/core/parse/parse.spec.js +95 -91
  37. package/src/core/prop.spec.js +4 -60
  38. package/src/core/sce/sce.js +1 -2
  39. package/src/core/sce/sce.spec.js +0 -8
  40. package/src/core/scope/scope.js +62 -32
  41. package/src/core/scope/scope.spec.js +25 -1960
  42. package/src/directive/aria/aria.js +3 -6
  43. package/src/directive/aria/aria.spec.js +0 -87
  44. package/src/directive/attrs/attrs.spec.js +0 -5
  45. package/src/directive/{list/list.test.js → attrs/attrs.test.js} +1 -1
  46. package/src/{core/q/q.html → directive/attrs/boolean.html} +1 -1
  47. package/src/directive/attrs/boolean.spec.js +0 -15
  48. package/src/{core/q/q.test.js → directive/attrs/boolean.test.js} +1 -2
  49. package/src/{core/timeout/timeout.html → directive/attrs/element-style.html} +4 -1
  50. package/src/directive/attrs/element-style.spec.js +0 -8
  51. package/src/{core/scope/scope.test.js → directive/attrs/element-style.test.js} +1 -2
  52. package/src/directive/attrs/src.spec.js +0 -7
  53. package/src/directive/bind/bind.spec.js +0 -33
  54. package/src/directive/bind/bing-html.spec.js +1 -4
  55. package/src/{core/interval/interval.html → directive/channel/channel.html} +1 -1
  56. package/src/directive/channel/channel.js +29 -0
  57. package/src/directive/channel/channel.spec.js +52 -0
  58. package/src/directive/channel/channel.test.js +9 -0
  59. package/src/directive/class/class.js +3 -3
  60. package/src/directive/class/class.spec.js +9 -75
  61. package/src/directive/controller/controller.spec.js +0 -13
  62. package/src/directive/events/click.spec.js +0 -3
  63. package/src/directive/events/event.spec.js +0 -6
  64. package/src/directive/form/form.js +14 -22
  65. package/src/directive/form/form.spec.js +0 -65
  66. package/src/directive/if/if.spec.js +2 -7
  67. package/src/directive/if/if.test.js +1 -2
  68. package/src/directive/include/include.js +2 -2
  69. package/src/directive/include/include.spec.js +8 -59
  70. package/src/directive/init/init.js +6 -2
  71. package/src/directive/init/init.spec.js +0 -2
  72. package/src/directive/input/input.js +1 -2
  73. package/src/directive/input/input.spec.js +191 -331
  74. package/src/directive/messages/messages.spec.js +4 -35
  75. package/src/directive/model/model.js +30 -42
  76. package/src/directive/model/model.spec.js +2 -49
  77. package/src/directive/model-options/model-options.js +22 -26
  78. package/src/directive/model-options/model-options.spec.js +0 -6
  79. package/src/directive/non-bindable/non-bindable.spec.js +0 -1
  80. package/src/directive/observe/observe.js +0 -1
  81. package/src/directive/observe/observe.spec.js +0 -1
  82. package/src/directive/options/options.js +1 -3
  83. package/src/directive/options/options.spec.js +3 -38
  84. package/src/directive/ref/href.spec.js +0 -15
  85. package/src/directive/repeat/repeat.js +2 -2
  86. package/src/directive/repeat/repeat.spec.js +56 -192
  87. package/src/directive/script/script.spec.js +0 -2
  88. package/src/directive/select/select.js +3 -3
  89. package/src/directive/select/select.spec.js +9 -106
  90. package/src/directive/show-hide/show-hide.js +2 -2
  91. package/src/directive/show-hide/show-hide.spec.js +8 -19
  92. package/src/directive/style/style.spec.js +0 -7
  93. package/src/directive/switch/switch.js +1 -2
  94. package/src/directive/switch/switch.spec.js +5 -5
  95. package/src/directive/validators/validators.spec.js +0 -1
  96. package/src/loader.js +0 -1
  97. package/src/public.js +75 -80
  98. package/src/router/common/coreservices.js +0 -2
  99. package/src/router/directives/state-directives.js +24 -30
  100. package/src/router/directives/state-directives.spec.js +0 -83
  101. package/src/router/directives/view-directive.js +6 -15
  102. package/src/router/directives/view-directive.spec.js +25 -71
  103. package/src/router/hooks/lazy-load.js +2 -2
  104. package/src/router/hooks/views.js +3 -5
  105. package/src/router/resolve/resolvable.js +3 -6
  106. package/src/router/resolve/resolve-context.js +2 -2
  107. package/src/router/state/state-service.js +4 -4
  108. package/src/router/state/state.spec.js +2 -5
  109. package/src/router/state/views.js +9 -12
  110. package/src/router/template-factory.js +3 -6
  111. package/src/router/template-factory.spec.js +0 -4
  112. package/src/router/transition/transition-hook.js +1 -1
  113. package/src/router/transition/transition.js +1 -1
  114. package/src/router/url/url-service.js +2 -8
  115. package/src/router/url/url-service.spec.js +3 -4
  116. package/src/router/view-hook.spec.js +2 -2
  117. package/src/router/view-scroll.js +4 -6
  118. package/src/services/http/http.js +11 -15
  119. package/src/services/http/http.spec.js +30 -31
  120. package/src/services/http/template-request.spec.js +0 -10
  121. package/src/services/http-backend/http-backend.js +19 -17
  122. package/src/services/http-backend/http-backend.spec.js +3 -3
  123. package/src/services/template-request.js +2 -4
  124. package/src/shared/common.js +6 -10
  125. package/src/shared/jqlite/jqlite.js +14 -15
  126. package/src/shared/jqlite/jqlite.spec.js +2 -2
  127. package/src/shared/utils.js +15 -92
  128. package/types/core/cache/cache.d.ts +1 -1
  129. package/types/core/model/model.d.ts +204 -0
  130. package/types/core/parse/parse.d.ts +26 -0
  131. package/types/core/scope/scope.d.ts +22 -21
  132. package/types/directive/channel/channel.d.ts +11 -0
  133. package/types/directive/form/form.d.ts +1 -0
  134. package/types/shared/common.d.ts +0 -1
  135. package/types/shared/utils.d.ts +0 -35
  136. package/src/core/interval/interval-factory.js +0 -50
  137. package/src/core/interval/interval.js +0 -77
  138. package/src/core/interval/interval.md +0 -123
  139. package/src/core/interval/interval.spec.js +0 -280
  140. package/src/core/q/q.js +0 -472
  141. package/src/core/q/q.md +0 -211
  142. package/src/core/q/q.spec.js +0 -2748
  143. package/src/core/timeout/timeout.js +0 -109
  144. package/src/core/timeout/timeout.spec.js +0 -354
  145. package/src/core/timeout/timout.test.js +0 -12
  146. package/src/directive/list/list.html +0 -18
  147. package/src/directive/list/list.js +0 -46
  148. package/src/directive/list/list.md +0 -22
  149. package/src/directive/list/list.spec.js +0 -172
  150. package/types/directive/list/list.d.ts +0 -4
@@ -24,10 +24,8 @@ describe("ngShow / ngHide", () => {
24
24
  it("should show and hide an element", () => {
25
25
  element = JQLite('<div ng-show="exp"></div>');
26
26
  element = $compile(element)($scope);
27
- $scope.$digest();
28
27
  expect(element[0].classList.contains("ng-hide")).toBeTrue();
29
28
  $scope.exp = true;
30
- $scope.$digest();
31
29
  expect(element[0].classList.contains("ng-hide")).toBeFalse();
32
30
  });
33
31
 
@@ -36,7 +34,6 @@ describe("ngShow / ngHide", () => {
36
34
  element = JQLite('<div ng-show="exp"></div>');
37
35
  element = $compile(element)($scope);
38
36
  $scope.exp = function () {};
39
- $scope.$digest();
40
37
  expect(element[0].classList.contains("ng-hide")).toBeFalse();
41
38
  });
42
39
 
@@ -45,7 +42,6 @@ describe("ngShow / ngHide", () => {
45
42
  element = $compile(element)($scope);
46
43
  expect(element[0].classList.contains("ng-hide")).toBeTrue();
47
44
  $scope.exp = true;
48
- $scope.$digest();
49
45
  expect(element[0].classList.contains("ng-hide")).toBeFalse();
50
46
  });
51
47
 
@@ -53,7 +49,6 @@ describe("ngShow / ngHide", () => {
53
49
  ["false", "undefined", "null", "NaN", "''", "0"].forEach((x) => {
54
50
  element = JQLite(`<div ng-show="${x}"></div>`);
55
51
  element = $compile(element)($scope);
56
- $scope.$digest();
57
52
  expect(element[0].classList.contains("ng-hide")).toBeTrue();
58
53
  });
59
54
  });
@@ -62,7 +57,6 @@ describe("ngShow / ngHide", () => {
62
57
  ["'f'", "'0'", "'false'", "'no'", "'n'", "'[]'"].forEach((x) => {
63
58
  element = JQLite(`<div ng-show="${x}"></div>`);
64
59
  element = $compile(element)($scope);
65
- $scope.$digest();
66
60
  expect(element[0].classList.contains("ng-hide")).toBeFalse();
67
61
  });
68
62
  });
@@ -71,7 +65,6 @@ describe("ngShow / ngHide", () => {
71
65
  ["[]", "{}"].forEach((x) => {
72
66
  element = JQLite(`<div ng-show="${x}"></div>`);
73
67
  element = $compile(element)($scope);
74
- $scope.$digest();
75
68
  expect(element[0].classList.contains("ng-hide")).toBeFalse();
76
69
  });
77
70
  });
@@ -83,7 +76,6 @@ describe("ngShow / ngHide", () => {
83
76
  element = $compile(element)($scope);
84
77
  expect(element[0].classList.contains("ng-hide")).toBeFalse();
85
78
  $scope.exp = true;
86
- $scope.$digest();
87
79
  expect(element[0].classList.contains("ng-hide")).toBeTrue();
88
80
  });
89
81
 
@@ -91,7 +83,6 @@ describe("ngShow / ngHide", () => {
91
83
  ["false", "undefined", "null", "NaN", "''", "0"].forEach((x) => {
92
84
  element = JQLite(`<div ng-hide="${x}"></div>`);
93
85
  element = $compile(element)($scope);
94
- $scope.$digest();
95
86
  expect(element[0].classList.contains("ng-hide")).toBeFalse();
96
87
  });
97
88
  });
@@ -100,7 +91,6 @@ describe("ngShow / ngHide", () => {
100
91
  ["'f'", "'0'", "'false'", "'no'", "'n'", "'[]'"].forEach((x) => {
101
92
  element = JQLite(`<div ng-hide="${x}"></div>`);
102
93
  element = $compile(element)($scope);
103
- $scope.$digest();
104
94
  expect(element[0].classList.contains("ng-hide")).toBeTrue();
105
95
  });
106
96
  });
@@ -109,7 +99,6 @@ describe("ngShow / ngHide", () => {
109
99
  ["[]", "{}"].forEach((x) => {
110
100
  element = JQLite(`<div ng-hide="${x}"></div>`);
111
101
  element = $compile(element)($scope);
112
- $scope.$digest();
113
102
  expect(element[0].classList.contains("ng-hide")).toBeTrue();
114
103
  });
115
104
  });
@@ -160,7 +149,7 @@ describe("ngShow / ngHide", () => {
160
149
  // const $scope = $rootScope.$new();
161
150
  // $scope.on = true;
162
151
  // element = $compile(html('<div ng-show="on">data</div>'))($scope);
163
- // $scope.$digest();
152
+ // ;
164
153
 
165
154
  // item = $animate.queue.shift();
166
155
  // expect(item.event).toBe("removeClass");
@@ -168,7 +157,7 @@ describe("ngShow / ngHide", () => {
168
157
  // expect(item.element).toBeShown();
169
158
 
170
159
  // $scope.on = false;
171
- // $scope.$digest();
160
+ // ;
172
161
 
173
162
  // item = $animate.queue.shift();
174
163
  // expect(item.event).toBe("addClass");
@@ -187,14 +176,14 @@ describe("ngShow / ngHide", () => {
187
176
  // element = $compile(
188
177
  // html('<div class="show-hide" ng-show="on">data</div>'),
189
178
  // )($scope);
190
- // $scope.$digest();
179
+ // ;
191
180
 
192
181
  // item = $animate.queue.shift();
193
182
  // expect(item.event).toEqual("addClass");
194
183
  // expect(item.options.tempClasses).toEqual("ng-hide-animate");
195
184
 
196
185
  // $scope.on = true;
197
- // $scope.$digest();
186
+ // ;
198
187
  // item = $animate.queue.shift();
199
188
  // expect(item.event).toEqual("removeClass");
200
189
  // expect(item.options.tempClasses).toEqual("ng-hide-animate");
@@ -211,7 +200,7 @@ describe("ngShow / ngHide", () => {
211
200
  // const $scope = $rootScope.$new();
212
201
  // $scope.off = true;
213
202
  // element = $compile(html('<div ng-hide="off">datum</div>'))($scope);
214
- // $scope.$digest();
203
+ // ;
215
204
 
216
205
  // item = $animate.queue.shift();
217
206
  // expect(item.event).toBe("addClass");
@@ -219,7 +208,7 @@ describe("ngShow / ngHide", () => {
219
208
  // expect(item.element).toBeHidden();
220
209
 
221
210
  // $scope.off = false;
222
- // $scope.$digest();
211
+ // ;
223
212
 
224
213
  // item = $animate.queue.shift();
225
214
  // expect(item.event).toBe("removeClass");
@@ -238,14 +227,14 @@ describe("ngShow / ngHide", () => {
238
227
  // element = $compile(
239
228
  // html('<div class="show-hide" ng-hide="on">data</div>'),
240
229
  // )($scope);
241
- // $scope.$digest();
230
+ // ;
242
231
 
243
232
  // item = $animate.queue.shift();
244
233
  // expect(item.event).toEqual("removeClass");
245
234
  // expect(item.options.tempClasses).toEqual("ng-hide-animate");
246
235
 
247
236
  // $scope.on = true;
248
- // $scope.$digest();
237
+ // ;
249
238
  // item = $animate.queue.shift();
250
239
  // expect(item.event).toEqual("addClass");
251
240
  // expect(item.options.tempClasses).toEqual("ng-hide-animate");
@@ -24,37 +24,31 @@ describe("ng-style", () => {
24
24
 
25
25
  it("should set", () => {
26
26
  element = $compile("<div ng-style=\"{height: '40px'}\"></div>")($scope);
27
- $scope.$digest();
28
27
  expect(element[0].style.height).toEqual("40px");
29
28
  });
30
29
 
31
30
  it("should silently ignore undefined style", () => {
32
31
  element = $compile('<div ng-style="myStyle"></div>')($scope);
33
- $scope.$digest();
34
32
  expect(element[0].classList.contains("ng-exception")).toBeFalsy();
35
33
  });
36
34
 
37
35
  it("should not deep watch objects", () => {
38
36
  element = $compile('<div ng-style="{height: heightObj}"></div>')($scope);
39
- $scope.$digest();
40
37
  expect(parseInt(element[0].style.height + 0, 10)).toEqual(0); // height could be '' or '0px'
41
38
  $scope.heightObj = {
42
39
  toString() {
43
40
  return "40px";
44
41
  },
45
42
  };
46
- $scope.$digest();
47
43
  expect(element[0].style.height).toBe("40px");
48
44
 
49
45
  element[0].style.height = "10px";
50
46
  $scope.heightObj.otherProp = 123;
51
- $scope.$digest();
52
47
  expect(element[0].style.height).toBe("10px");
53
48
  });
54
49
 
55
50
  it("should support binding for object literals", () => {
56
51
  element = $compile('<div ng-style="{height: heightStr}"></div>')($scope);
57
- $scope.$digest();
58
52
  expect(parseInt(element[0].style.height + 0, 10)).toEqual(0); // height could be '' or '0px'
59
53
  $scope.$apply('heightStr = "40px"');
60
54
  expect(element[0].style.height).toBe("40px");
@@ -65,7 +59,6 @@ describe("ng-style", () => {
65
59
 
66
60
  it("should support lazy one-time binding for object literals", () => {
67
61
  element = $compile('<div ng-style="::{height: heightStr}"></div>')($scope);
68
- $scope.$digest();
69
62
  expect(parseInt(element[0].style.height + 0, 10)).toEqual(0); // height could be '' or '0px'
70
63
  $scope.$apply('heightStr = "40px"');
71
64
  expect(element[0].style.height).toBe("40px");
@@ -1,4 +1,3 @@
1
- import { forEach } from "../../shared/utils";
2
1
  import { getBlockNodes } from "../../shared/jqlite/jqlite";
3
2
 
4
3
  export const ngSwitchDirective = [
@@ -53,7 +52,7 @@ export const ngSwitchDirective = [
53
52
  ngSwitchController.cases[`!${value}`] ||
54
53
  ngSwitchController.cases["?"])
55
54
  ) {
56
- forEach(selectedTranscludes, (selectedTransclude) => {
55
+ Object.values(selectedTranscludes).forEach((selectedTransclude) => {
57
56
  selectedTransclude.transclude((caseElement, selectedScope) => {
58
57
  selectedScopes.push(selectedScope);
59
58
  const anchor = selectedTransclude.element;
@@ -570,9 +570,9 @@ describe("ngSwitch", () => {
570
570
  // ),
571
571
  // )($scope);
572
572
 
573
- // $rootScope.$digest(); // re-enable the animations;
573
+ // ; // re-enable the animations;
574
574
  // $scope.val = "one";
575
- // $scope.$digest();
575
+ // ;
576
576
 
577
577
  // item = $animate.queue.shift();
578
578
  // expect(item.event).toBe("enter");
@@ -596,16 +596,16 @@ describe("ngSwitch", () => {
596
596
  // ),
597
597
  // )($scope);
598
598
 
599
- // $rootScope.$digest(); // re-enable the animations;
599
+ // ; // re-enable the animations;
600
600
  // $scope.val = "two";
601
- // $scope.$digest();
601
+ // ;
602
602
 
603
603
  // item = $animate.queue.shift();
604
604
  // expect(item.event).toBe("enter");
605
605
  // expect(item.element.text()).toBe("two");
606
606
 
607
607
  // $scope.val = "three";
608
- // $scope.$digest();
608
+ // ;
609
609
 
610
610
  // item = $animate.queue.shift();
611
611
  // expect(item.event).toBe("leave");
@@ -640,7 +640,6 @@ describe("validators", () => {
640
640
  inputElm = $compile(
641
641
  '<input type="text" ng-model="notDefined" required />',
642
642
  )($rootScope);
643
- $rootScope.$digest();
644
643
  expect(inputElm[0].classList.contains("ng-invalid")).toBeTrue();
645
644
  });
646
645
 
package/src/loader.js CHANGED
@@ -152,7 +152,6 @@ export class Angular {
152
152
  });
153
153
  // ng-route deps
154
154
  services.$injector = $injector;
155
- services.$q = $injector.get("$q");
156
155
  // https://github.com/angular-ui/ui-router/issues/3678
157
156
  if (!Object.prototype.hasOwnProperty.call($injector, "strictDi")) {
158
157
  try {
package/src/public.js CHANGED
@@ -1,93 +1,88 @@
1
- import { CompileProvider } from "./core/compile/compile";
1
+ import { CompileProvider } from "./core/compile/compile.js";
2
2
  import {
3
3
  inputDirective,
4
4
  ngValueDirective,
5
5
  hiddenInputBrowserCacheDirective,
6
- } from "./directive/input/input";
7
- import { formDirective, ngFormDirective } from "./directive/form/form";
8
- import { scriptDirective } from "./directive/script/script";
9
- import { selectDirective, optionDirective } from "./directive/select/select";
6
+ } from "./directive/input/input.js";
7
+ import { formDirective, ngFormDirective } from "./directive/form/form.js";
8
+ import { scriptDirective } from "./directive/script/script.js";
9
+ import { selectDirective, optionDirective } from "./directive/select/select.js";
10
10
  import {
11
11
  ngBindDirective,
12
12
  ngBindHtmlDirective,
13
13
  ngBindTemplateDirective,
14
- } from "./directive/bind/bind";
14
+ } from "./directive/bind/bind.js";
15
15
  import {
16
16
  ngClassDirective,
17
17
  ngClassEvenDirective,
18
18
  ngClassOddDirective,
19
- } from "./directive/class/class";
20
- import { ngCloakDirective } from "./directive/cloak/cloak";
21
- import { ngControllerDirective } from "./directive/controller/controller";
19
+ } from "./directive/class/class.js";
20
+ import { ngCloakDirective } from "./directive/cloak/cloak.js";
21
+ import { ngControllerDirective } from "./directive/controller/controller.js";
22
22
  import {
23
23
  ngHideDirective,
24
24
  ngShowDirective,
25
- } from "./directive/show-hide/show-hide";
26
- import { ngIfDirective } from "./directive/if/if";
25
+ } from "./directive/show-hide/show-hide.js";
26
+ import { ngIfDirective } from "./directive/if/if.js";
27
27
  import {
28
28
  ngIncludeDirective,
29
29
  ngIncludeFillContentDirective,
30
- } from "./directive/include/include";
31
- import { ngInitDirective } from "./directive/init/init";
32
- import { ngNonBindableDirective } from "./directive/non-bindable/non-bindable";
33
- import { ngRefDirective } from "./directive/ref/ref";
34
- import { ngRepeatDirective } from "./directive/repeat/repeat";
35
- import { ngStyleDirective } from "./directive/style/style";
30
+ } from "./directive/include/include.js";
31
+ import { ngInitDirective } from "./directive/init/init.js";
32
+ import { ngNonBindableDirective } from "./directive/non-bindable/non-bindable.js";
33
+ import { ngRefDirective } from "./directive/ref/ref.js";
34
+ import { ngRepeatDirective } from "./directive/repeat/repeat.js";
35
+ import { ngStyleDirective } from "./directive/style/style.js";
36
36
  import {
37
37
  ngSwitchDirective,
38
38
  ngSwitchWhenDirective,
39
39
  ngSwitchDefaultDirective,
40
- } from "./directive/switch/switch";
41
- import { ngOptionsDirective } from "./directive/options/options";
42
- import { ngTranscludeDirective } from "./directive/transclude/transclude";
43
- import { ngModelDirective } from "./directive/model/model";
44
- import { ngListDirective } from "./directive/list/list";
45
- import { ngChangeDirective } from "./directive/change/change";
40
+ } from "./directive/switch/switch.js";
41
+ import { ngOptionsDirective } from "./directive/options/options.js";
42
+ import { ngTranscludeDirective } from "./directive/transclude/transclude.js";
43
+ import { ngModelDirective } from "./directive/model/model.js";
44
+ import { ngChangeDirective } from "./directive/change/change.js";
46
45
  import {
47
46
  maxlengthDirective,
48
47
  minlengthDirective,
49
48
  patternDirective,
50
49
  requiredDirective,
51
- } from "./directive/validators/validators";
52
- import { ngModelOptionsDirective } from "./directive/model-options/model-options";
53
- import { ngAttributeAliasDirectives } from "./directive/attrs/attrs";
54
- import { ngEventDirectives } from "./directive/events/events";
55
- import { AnchorScrollProvider } from "./services/anchor-scroll";
56
- import { AnimateProvider } from "./animations/animate";
57
- import { BrowserProvider } from "./services/browser";
50
+ } from "./directive/validators/validators.js";
51
+ import { ngModelOptionsDirective } from "./directive/model-options/model-options.js";
52
+ import { ngAttributeAliasDirectives } from "./directive/attrs/attrs.js";
53
+ import { ngEventDirectives } from "./directive/events/events.js";
54
+ import { AnchorScrollProvider } from "./services/anchor-scroll.js";
55
+ import { AnimateProvider } from "./animations/animate.js";
56
+ import { BrowserProvider } from "./services/browser.js";
58
57
  import {
59
58
  AnimateAsyncRunFactoryProvider,
60
59
  AnimateRunnerFactoryProvider,
61
- } from "./animations/animate-runner";
62
- import { TemplateCacheProvider } from "./core/cache/cache-factory";
63
- import { ControllerProvider } from "./core/controller/controller";
64
- import { ExceptionHandlerProvider } from "./core/exception-handler";
65
- import { FilterProvider } from "./core/filter/filter";
66
- import { IntervalProvider } from "./core/interval/interval";
67
- import { InterpolateProvider } from "./core/interpolate/interpolate";
68
- import { $IntervalFactoryProvider } from "./core/interval/interval-factory";
60
+ } from "./animations/animate-runner.js";
61
+ import { TemplateCacheProvider } from "./core/cache/cache-factory.js";
62
+ import { ControllerProvider } from "./core/controller/controller.js";
63
+ import { ExceptionHandlerProvider } from "./core/exception-handler.js";
64
+ import { FilterProvider } from "./core/filter/filter.js";
65
+ import { InterpolateProvider } from "./core/interpolate/interpolate.js";
69
66
  import {
70
67
  HttpProvider,
71
68
  HttpParamSerializerProvider,
72
- } from "./services/http/http";
73
- import { HttpBackendProvider } from "./services/http-backend/http-backend";
74
- import { LocationProvider } from "./core/location/location";
75
- import { LogProvider } from "./services/log";
69
+ } from "./services/http/http.js";
70
+ import { HttpBackendProvider } from "./services/http-backend/http-backend.js";
71
+ import { LocationProvider } from "./core/location/location.js";
72
+ import { LogProvider } from "./services/log.js";
76
73
  import { ParseProvider } from "./core/parse/parse.js";
77
- import { RootScopeProvider } from "./core/scope/scope";
78
- import { $QProvider } from "./core/q/q";
79
- import { SceProvider, SceDelegateProvider } from "./core/sce/sce";
80
- import { TaskTrackerFactoryProvider } from "./core/task-tracker-factory";
81
- import { TemplateRequestProvider } from "./services/template-request";
82
- import { TimeoutProvider } from "./core/timeout/timeout";
83
- import { SanitizeUriProvider } from "./core/sanitize/sanitize-uri";
74
+ import { RootModelProvider } from "./core/model/model.js";
75
+ import { SceProvider, SceDelegateProvider } from "./core/sce/sce.js";
76
+ import { TaskTrackerFactoryProvider } from "./core/task-tracker-factory.js";
77
+ import { TemplateRequestProvider } from "./services/template-request.js";
78
+ import { SanitizeUriProvider } from "./core/sanitize/sanitize-uri.js";
84
79
  import {
85
80
  ngMessageDefaultDirective,
86
81
  ngMessageDirective,
87
82
  ngMessageExpDirective,
88
83
  ngMessagesDirective,
89
84
  ngMessagesIncludeDirective,
90
- } from "./directive/messages/messages";
85
+ } from "./directive/messages/messages.js";
91
86
  import {
92
87
  AriaProvider,
93
88
  ngCheckedAriaDirective,
@@ -101,34 +96,38 @@ import {
101
96
  ngRequiredAriaDirective,
102
97
  ngShowAriaDirective,
103
98
  ngValueAriaDirective,
104
- } from "./directive/aria/aria";
105
- import { AnimateCssProvider } from "./animations/animate-css";
106
- import { AnimateQueueProvider } from "./animations/animate-queue";
107
- import { AnimateJsProvider } from "./animations/animate-js";
108
- import { AnimationProvider } from "./animations/animation";
109
- import { RafSchedulerProvider } from "./animations/raf-scheduler";
110
- import { AnimateCacheProvider } from "./animations/animate-cache";
111
- import { AnimateCssDriverProvider } from "./animations/animate-css-driver";
112
- import { AnimateJsDriverProvider } from "./animations/animate-js-driver";
113
- import { ngAnimateSwapDirective } from "./animations/animate-swap";
114
- import { $$AnimateChildrenDirective } from "./animations/animate-children-directive";
115
- import { UrlConfigProvider } from "./router/url/url-config";
116
- import { UIRouterGlobals } from "./router/globals";
117
- import { ViewService } from "./router/view/view";
118
- import { TransitionProvider } from "./router/transition/transition-service";
119
- import { StateProvider } from "./router/state/state-service";
120
- import { ViewScrollProvider } from "./router/view-scroll";
121
- import { TemplateFactoryProvider } from "./router/template-factory";
122
- import { UrlService } from "./router/url/url-service";
123
- import { StateRegistryProvider } from "./router/state/state-registry";
124
- import { trace } from "./router/common/trace";
99
+ } from "./directive/aria/aria.js";
100
+ import { AnimateCssProvider } from "./animations/animate-css.js";
101
+ import { AnimateQueueProvider } from "./animations/animate-queue.js";
102
+ import { AnimateJsProvider } from "./animations/animate-js.js";
103
+ import { AnimationProvider } from "./animations/animation.js";
104
+ import { RafSchedulerProvider } from "./animations/raf-scheduler.js";
105
+ import { AnimateCacheProvider } from "./animations/animate-cache.js";
106
+ import { AnimateCssDriverProvider } from "./animations/animate-css-driver.js";
107
+ import { AnimateJsDriverProvider } from "./animations/animate-js-driver.js";
108
+ import { ngAnimateSwapDirective } from "./animations/animate-swap.js";
109
+ import { $$AnimateChildrenDirective } from "./animations/animate-children-directive.js";
110
+ import { UrlConfigProvider } from "./router/url/url-config.js";
111
+ import { UIRouterGlobals } from "./router/globals.js";
112
+ import { ViewService } from "./router/view/view.js";
113
+ import { TransitionProvider } from "./router/transition/transition-service.js";
114
+ import { StateProvider } from "./router/state/state-service.js";
115
+ import { ViewScrollProvider } from "./router/view-scroll.js";
116
+ import { TemplateFactoryProvider } from "./router/template-factory.js";
117
+ import { UrlService } from "./router/url/url-service.js";
118
+ import { StateRegistryProvider } from "./router/state/state-registry.js";
119
+ import { trace } from "./router/common/trace.js";
125
120
  import {
126
121
  $StateRefActiveDirective,
127
122
  $StateRefDirective,
128
123
  $StateRefDynamicDirective,
129
- } from "./router/directives/state-directives";
130
- import { $ViewDirectiveFill, ngView } from "./router/directives/view-directive";
131
- import { ngObserveDirective } from "./directive/observe/observe";
124
+ } from "./router/directives/state-directives.js";
125
+ import {
126
+ $ViewDirectiveFill,
127
+ ngView,
128
+ } from "./router/directives/view-directive.js";
129
+ import { ngObserveDirective } from "./directive/observe/observe.js";
130
+ import { ngChannelDirective } from "./directive/channel/channel.js";
132
131
 
133
132
  /**
134
133
  * @type {string} `version` from `package.json`, injected by Rollup plugin
@@ -192,7 +191,6 @@ export function publishExternalAPI(angular) {
192
191
  ngOptions: ngOptionsDirective,
193
192
  ngTransclude: ngTranscludeDirective,
194
193
  ngModel: ngModelDirective,
195
- ngList: ngListDirective,
196
194
  ngChange: ngChangeDirective,
197
195
  pattern: patternDirective,
198
196
  ngPattern: patternDirective,
@@ -225,6 +223,7 @@ export function publishExternalAPI(angular) {
225
223
  ngSrefActiveEq: $StateRefActiveDirective,
226
224
  ngState: $StateRefDynamicDirective,
227
225
  ngView: ngView,
226
+ ngChannel: ngChannelDirective,
228
227
  })
229
228
  .directive({
230
229
  ngView: $ViewDirectiveFill,
@@ -249,8 +248,6 @@ export function publishExternalAPI(angular) {
249
248
  $exceptionHandler: ExceptionHandlerProvider,
250
249
  $filter: FilterProvider,
251
250
  $interpolate: InterpolateProvider,
252
- $interval: IntervalProvider,
253
- $$intervalFactory: $IntervalFactoryProvider,
254
251
  $http: HttpProvider,
255
252
  $httpParamSerializer: HttpParamSerializerProvider,
256
253
  $httpBackend: HttpBackendProvider,
@@ -258,15 +255,13 @@ export function publishExternalAPI(angular) {
258
255
  $log: LogProvider,
259
256
  $parse: ParseProvider,
260
257
  $$rAFScheduler: RafSchedulerProvider,
261
- $rootScope: RootScopeProvider,
258
+ $rootScope: RootModelProvider,
262
259
  $routerGlobals: UIRouterGlobals,
263
- $q: $QProvider,
264
260
  $sce: SceProvider,
265
261
  $sceDelegate: SceDelegateProvider,
266
262
  $$taskTrackerFactory: TaskTrackerFactoryProvider,
267
263
  $templateCache: TemplateCacheProvider,
268
264
  $templateRequest: TemplateRequestProvider,
269
- $timeout: TimeoutProvider,
270
265
  $urlConfig: UrlConfigProvider,
271
266
  $view: ViewService,
272
267
  $transitions: TransitionProvider,
@@ -1,6 +1,4 @@
1
1
  export const services = {
2
- /** @type {import("../../core/q/q").QService} */
3
- $q: undefined,
4
2
  /** @type {import("../../core/di/internal-injector").InjectorService} */
5
3
  $injector: undefined,
6
4
  };
@@ -1,4 +1,4 @@
1
- import { forEach, tail, unnestR, uniqR, removeFrom } from "../../shared/common";
1
+ import { tail, unnestR, uniqR, removeFrom } from "../../shared/common";
2
2
  import { isString, isObject } from "../../shared/utils";
3
3
 
4
4
  import { parse } from "../../shared/hof";
@@ -43,7 +43,7 @@ function getTypeInfo(el) {
43
43
  };
44
44
  }
45
45
  /** @ignore */
46
- function clickHook(el, $state, $timeout, type, getDef) {
46
+ function clickHook(el, $state, type, getDef) {
47
47
  return function (e) {
48
48
  const button = e.which || e.button,
49
49
  target = getDef();
@@ -57,7 +57,7 @@ function clickHook(el, $state, $timeout, type, getDef) {
57
57
  el.attr("target");
58
58
  if (!res) {
59
59
  // HACK: This is to allow ng-clicks to be processed before the transition is initiated:
60
- const transition = $timeout(function () {
60
+ const transition = setTimeout(function () {
61
61
  if (!el.attr("disabled")) {
62
62
  $state.go(target.ngState, target.ngStateParams, target.ngStateOpts);
63
63
  }
@@ -66,7 +66,7 @@ function clickHook(el, $state, $timeout, type, getDef) {
66
66
  // if the state has no URL, ignore one preventDefault from the <a> directive.
67
67
  let ignorePreventDefaultCount = type.isAnchor && !target.href ? 1 : 0;
68
68
  e.preventDefault = function () {
69
- if (ignorePreventDefaultCount-- <= 0) $timeout.cancel(transition);
69
+ if (ignorePreventDefaultCount-- <= 0) clearTimeout(transition);
70
70
  };
71
71
  } else {
72
72
  // ignored
@@ -106,15 +106,9 @@ function bindEvents(element, scope, hookFn, ngStateOpts) {
106
106
 
107
107
  // // TODO: SEPARATE THESE OUT
108
108
 
109
- $StateRefDirective.$inject = [
110
- "$state",
111
- "$timeout",
112
- "$stateRegistry",
113
- "$transitions",
114
- ];
109
+ $StateRefDirective.$inject = ["$state", "$stateRegistry", "$transitions"];
115
110
  export function $StateRefDirective(
116
111
  $stateService,
117
- $timeout,
118
112
  $stateRegistry,
119
113
  $transitions,
120
114
  ) {
@@ -155,7 +149,7 @@ export function $StateRefDirective(
155
149
  scope.$on("$destroy", $stateRegistry.onStatesChanged(update));
156
150
  scope.$on("$destroy", $transitions.onSuccess({}, update));
157
151
  if (!type.clickable) return;
158
- const hookFn = clickHook(element, $state, $timeout, type, getDef);
152
+ const hookFn = clickHook(element, $state, type, getDef);
159
153
  bindEvents(element, scope, hookFn, rawDef.ngStateOpts);
160
154
  },
161
155
  };
@@ -163,13 +157,11 @@ export function $StateRefDirective(
163
157
 
164
158
  $StateRefDynamicDirective.$inject = [
165
159
  "$state",
166
- "$timeout",
167
160
  "$stateRegistry",
168
161
  "$transitions",
169
162
  ];
170
163
  export function $StateRefDynamicDirective(
171
164
  $state,
172
- $timeout,
173
165
  $stateRegistry,
174
166
  $transitions,
175
167
  ) {
@@ -213,7 +205,7 @@ export function $StateRefDynamicDirective(
213
205
  scope.$on("$destroy", $stateRegistry.onStatesChanged(update));
214
206
  scope.$on("$destroy", $transitions.onSuccess({}, update));
215
207
  if (!type.clickable) return;
216
- hookFn = clickHook(element, $state, $timeout, type, getDef);
208
+ hookFn = clickHook(element, $state, type, getDef);
217
209
  bindEvents(element, scope, hookFn, rawDef.ngStateOpts);
218
210
  },
219
211
  };
@@ -303,22 +295,24 @@ export function $StateRefActiveDirective(
303
295
  function setStatesFromDefinitionObject(statesDefinition) {
304
296
  if (isObject(statesDefinition)) {
305
297
  states = [];
306
- forEach(statesDefinition, function (stateOrName, activeClass) {
307
- // Helper function to abstract adding state.
308
- const addStateForClass = function (stateOrName, activeClass) {
309
- const ref = parseStateRef(stateOrName);
310
- addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);
311
- };
312
- if (isString(stateOrName)) {
313
- // If state is string, just add it.
314
- addStateForClass(stateOrName, activeClass);
315
- } else if (Array.isArray(stateOrName)) {
316
- // If state is an array, iterate over it and add each array item individually.
317
- forEach(stateOrName, function (stateOrName) {
298
+ Object.entries(statesDefinition).forEach(
299
+ ([activeClass, stateOrName]) => {
300
+ // Helper function to abstract adding state.
301
+ const addStateForClass = function (stateOrName, activeClass) {
302
+ const ref = parseStateRef(stateOrName);
303
+ addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);
304
+ };
305
+ if (isString(stateOrName)) {
306
+ // If state is string, just add it.
318
307
  addStateForClass(stateOrName, activeClass);
319
- });
320
- }
321
- });
308
+ } else if (Array.isArray(stateOrName)) {
309
+ // If state is an array, iterate over it and add each array item individually.
310
+ stateOrName.forEach((stateOrName) => {
311
+ addStateForClass(stateOrName, activeClass);
312
+ });
313
+ }
314
+ },
315
+ );
322
316
  }
323
317
  }
324
318
  function addState(stateName, stateParams, activeClass) {