@angular-wave/angular.ts 0.3.0 → 0.4.0

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 (115) hide show
  1. package/.github/workflows/ci.yml +57 -0
  2. package/README.md +1 -1
  3. package/dist/angular-ts.esm.js +2 -2
  4. package/dist/angular-ts.umd.js +2 -2
  5. package/package.json +1 -1
  6. package/src/animations/animate-cache.js +1 -1
  7. package/src/animations/animate-css-driver.js +2 -2
  8. package/src/animations/animate-css.js +1 -1
  9. package/src/animations/animate-js-driver.js +2 -2
  10. package/src/animations/animate-js.js +2 -2
  11. package/src/animations/animate-queue.js +2 -2
  12. package/src/animations/animation.js +1 -1
  13. package/src/core/cache/cache-factory.js +18 -2
  14. package/src/core/compile/attributes.js +1 -1
  15. package/src/core/compile/compile.js +10 -12
  16. package/src/core/compile/compile.spec.js +0 -1
  17. package/src/core/compile/compile.test.js +1 -1
  18. package/src/core/controller/controller.js +1 -1
  19. package/src/core/exception-handler.js +2 -6
  20. package/src/core/filter/filter.js +2 -2
  21. package/src/core/interpolate/interpolate.js +3 -3
  22. package/src/core/interval/interval-factory.js +7 -23
  23. package/src/core/interval/interval.js +1 -1
  24. package/src/core/interval/interval.spec.js +0 -25
  25. package/src/core/location/location.js +1 -1
  26. package/src/core/location/location.spec.js +3 -3
  27. package/src/core/parser/parse.js +2 -2
  28. package/src/core/q/q.js +0 -27
  29. package/src/core/q/q.spec.js +0 -44
  30. package/src/core/sce/sce.js +2 -2
  31. package/src/core/scope/scope.js +35 -41
  32. package/src/core/scope/scope.spec.js +71 -13
  33. package/src/core/task-tracker-factory.js +1 -1
  34. package/src/core/timeout/timeout.js +4 -8
  35. package/src/directive/attrs/attrs.js +1 -1
  36. package/src/directive/if/if.js +5 -5
  37. package/src/directive/input/input.spec.js +0 -1
  38. package/src/directive/observe/observe.html +18 -0
  39. package/src/directive/observe/observe.js +37 -0
  40. package/src/directive/observe/observe.spec.js +92 -0
  41. package/src/directive/observe/observe.test.js +9 -0
  42. package/src/directive/observe/test.html +197 -0
  43. package/src/directive/script/script.js +11 -9
  44. package/src/directive/validators/validators.js +70 -42
  45. package/src/public.js +63 -66
  46. package/src/router/params/param.js +1 -2
  47. package/src/router/path/path-node.js +5 -5
  48. package/src/router/path/path-utils.js +19 -21
  49. package/src/router/state/state-builder.js +17 -11
  50. package/src/router/state/state-queue-manager.js +16 -7
  51. package/src/router/state/state-registry.js +9 -5
  52. package/src/router/state/state-service.js +7 -11
  53. package/src/router/template-factory.js +2 -2
  54. package/src/router/transition/transition-service.js +1 -1
  55. package/src/router/transition/transition.js +13 -11
  56. package/src/router/url/url-matcher.js +2 -2
  57. package/src/router/url/url-service.js +1 -1
  58. package/src/router/view/view.js +3 -3
  59. package/src/router/view-scroll.js +13 -8
  60. package/src/services/http/http.js +2 -82
  61. package/src/services/http/http.spec.js +0 -118
  62. package/src/services/http/template-request.spec.js +10 -12
  63. package/src/services/http-backend/http-backend.js +1 -1
  64. package/src/services/log.js +1 -7
  65. package/src/services/template-request.js +3 -3
  66. package/src/shared/common.js +3 -9
  67. package/src/shared/hof.js +6 -8
  68. package/src/types.js +0 -14
  69. package/types/animations/animate-cache.d.ts +2 -2
  70. package/types/animations/animate-css-driver.d.ts +3 -3
  71. package/types/animations/animate-css.d.ts +2 -2
  72. package/types/animations/animate-js-driver.d.ts +3 -3
  73. package/types/animations/animate-js.d.ts +3 -3
  74. package/types/animations/animate-queue.d.ts +3 -3
  75. package/types/animations/animation.d.ts +2 -2
  76. package/types/core/cache/cache-factory.d.ts +20 -2
  77. package/types/core/compile/attributes.d.ts +3 -3
  78. package/types/core/compile/compile.d.ts +12 -12
  79. package/types/core/controller/controller.d.ts +1 -1
  80. package/types/core/exception-handler.d.ts +3 -4
  81. package/types/core/filter/filter.d.ts +3 -3
  82. package/types/core/interpolate/interpolate.d.ts +6 -6
  83. package/types/core/interval/interval-factory.d.ts +3 -3
  84. package/types/core/interval/interval.d.ts +2 -2
  85. package/types/core/location/location.d.ts +2 -2
  86. package/types/core/parser/parse.d.ts +4 -4
  87. package/types/core/q/q.d.ts +0 -5
  88. package/types/core/sce/sce.d.ts +4 -4
  89. package/types/core/scope/scope.d.ts +12 -3
  90. package/types/core/task-tracker-factory.d.ts +1 -1
  91. package/types/core/timeout/timeout.d.ts +3 -4
  92. package/types/directive/observe/observe.d.ts +4 -0
  93. package/types/directive/script/script.d.ts +8 -5
  94. package/types/directive/validators/validators.d.ts +3 -15
  95. package/types/router/path/path-node.d.ts +0 -7
  96. package/types/router/path/path-utils.d.ts +7 -2
  97. package/types/router/state/state-queue-manager.d.ts +13 -3
  98. package/types/router/state/state-registry.d.ts +5 -2
  99. package/types/router/state/state-service.d.ts +2 -2
  100. package/types/router/template-factory.d.ts +3 -3
  101. package/types/router/transition/transition-service.d.ts +1 -1
  102. package/types/router/transition/transition.d.ts +3 -3
  103. package/types/router/url/url-service.d.ts +3 -3
  104. package/types/router/view-scroll.d.ts +3 -3
  105. package/types/services/http/http.d.ts +4 -48
  106. package/types/services/http-backend/http-backend.d.ts +2 -2
  107. package/types/services/log.d.ts +2 -8
  108. package/types/services/template-request.d.ts +1 -1
  109. package/types/shared/common.d.ts +0 -5
  110. package/types/shared/hof.d.ts +0 -1
  111. package/types/types.d.ts +1 -1
  112. package/.github/workflows/lint.yml +0 -19
  113. package/.github/workflows/playwright.yml +0 -27
  114. package/.github/workflows/types.yml +0 -19
  115. package/src/directive/csp.md +0 -63
@@ -0,0 +1,197 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>AngularTS Test Runner</title>
6
+
7
+ <link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
8
+ <script type="module" src="/src/index.js"></script>
9
+ <link
10
+ href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
11
+ rel="stylesheet"
12
+ />
13
+ <script>
14
+ // Define a custom web component called <test-component>
15
+ class TestComponent extends HTMLElement {
16
+ // Called when the element is added to the DOM
17
+ connectedCallback() {
18
+ // Get the value of the 'greeting' attribute
19
+ const greeting = this.getAttribute("greeting") || "world";
20
+
21
+ // Set the inner HTML to display the greeting
22
+ this.innerHTML = `<p>Hello ${greeting}</p>`;
23
+ }
24
+
25
+ // Define which attributes to observe
26
+ static get observedAttributes() {
27
+ return ["greeting"];
28
+ }
29
+
30
+ // Called when an observed attribute changes
31
+ attributeChangedCallback(name, oldValue, newValue) {
32
+ if (name === "greeting") {
33
+ this.innerHTML = `<p>Hello ${newValue}</p>`;
34
+ }
35
+ }
36
+ }
37
+
38
+ // Register the custom element
39
+ customElements.define("test-component", TestComponent);
40
+ </script>
41
+
42
+ <script>
43
+ document.addEventListener("DOMContentLoaded", () => {
44
+ var app = window.angular.module("myApp", []);
45
+ });
46
+ </script>
47
+ <script type="module">
48
+ import {
49
+ fluentSelect,
50
+ fluentOption,
51
+ fluentTab,
52
+ fluentTabPanel,
53
+ fluentTabs,
54
+ provideFluentDesignSystem,
55
+ fluentRadio,
56
+ fluentRadioGroup,
57
+ fluentSwitch,
58
+ } from "https://unpkg.com/@fluentui/web-components@2.0.0";
59
+ provideFluentDesignSystem().register(
60
+ fluentSelect(),
61
+ fluentTab(),
62
+ fluentTabPanel(),
63
+ fluentTabs(),
64
+ fluentRadio(),
65
+ fluentRadioGroup(),
66
+ fluentSwitch(),
67
+ );
68
+ </script>
69
+ </head>
70
+ <body ng-app="myApp">
71
+ <div id="dummy">{{ greeting }}</div>
72
+ <input ng-model="greeting" />
73
+
74
+ <test-component greeting="{{ greeting }}"></test-component>
75
+ <div>{{ greeting }}</div>
76
+
77
+ <fluent-select
78
+ ng-observe="current-value"
79
+ data-update="greeting"
80
+ title="Select a section"
81
+ >
82
+ <fluent-option value="Beginning">Beginning</fluent-option>
83
+ <fluent-option value="Middle">Middle</fluent-option>
84
+ <fluent-option value="End">End</fluent-option>
85
+ </fluent-select>
86
+ <br />
87
+
88
+ {{ activeid }}
89
+ <fluent-tabs
90
+ ng-observe="activeid"
91
+ data-update="activeid"
92
+ activeid="entrees"
93
+ >
94
+ <fluent-tab id="apps">Appetizers</fluent-tab>
95
+ <fluent-tab id="entrees">Entrees</fluent-tab>
96
+ <fluent-tab id="desserts">Desserts</fluent-tab>
97
+ <fluent-tab-panel id="appsPanel">
98
+ <ol>
99
+ <li>
100
+ <fluent-anchor href="#" appearance="hypertext"
101
+ >Stuffed artichokes</fluent-anchor
102
+ >
103
+ </li>
104
+ <li>
105
+ <fluent-anchor href="#" appearance="hypertext"
106
+ >Bruschetta</fluent-anchor
107
+ >
108
+ </li>
109
+ <li>
110
+ <fluent-anchor href="#" appearance="hypertext"
111
+ >Oven-baked polenta</fluent-anchor
112
+ >
113
+ </li>
114
+ <li>
115
+ <fluent-anchor href="#" appearance="hypertext"
116
+ >Salami and Fig Crostini with Ricotta</fluent-anchor
117
+ >
118
+ </li>
119
+ <li>
120
+ <fluent-anchor href="#" appearance="hypertext"
121
+ >Rosemary-Potato Focaccia with Goat Cheese</fluent-anchor
122
+ >
123
+ </li>
124
+ </ol>
125
+ </fluent-tab-panel>
126
+ <fluent-tab-panel id="entreesPanel">
127
+ <ol>
128
+ <li>
129
+ <fluent-anchor href="#" appearance="hypertext"
130
+ >Mushroom-Sausage Ragù</fluent-anchor
131
+ >
132
+ </li>
133
+ <li>
134
+ <fluent-anchor href="#" appearance="hypertext"
135
+ >Tomato Bread Soup with Steamed Mussels</fluent-anchor
136
+ >
137
+ </li>
138
+ <li>
139
+ <fluent-anchor href="#" appearance="hypertext"
140
+ >Grilled Fish with Artichoke Caponata</fluent-anchor
141
+ >
142
+ </li>
143
+ <li>
144
+ <fluent-anchor href="#" appearance="hypertext"
145
+ >Celery Root and Mushroom Lasagna</fluent-anchor
146
+ >
147
+ </li>
148
+ <li>
149
+ <fluent-anchor href="#" appearance="hypertext"
150
+ >Osso Buco with Citrus Gremolata</fluent-anchor
151
+ >
152
+ </li>
153
+ </ol>
154
+ </fluent-tab-panel>
155
+ <fluent-tab-panel id="dessertsPanel">
156
+ <ol>
157
+ <li>
158
+ <fluent-anchor href="#" appearance="hypertext"
159
+ >Tiramisu</fluent-anchor
160
+ >
161
+ </li>
162
+ <li>
163
+ <fluent-anchor href="#" appearance="hypertext"
164
+ >Spumoni</fluent-anchor
165
+ >
166
+ </li>
167
+ <li>
168
+ <fluent-anchor href="#" appearance="hypertext"
169
+ >Limoncello and Ice Cream with Biscotti</fluent-anchor
170
+ >
171
+ </li>
172
+ </ol>
173
+ </fluent-tab-panel>
174
+ </fluent-tabs>
175
+
176
+ {{ radio }}
177
+
178
+ <fluent-radio-group
179
+ ng-observe="value"
180
+ data-update="radio"
181
+ orientation="vertical"
182
+ >
183
+ <fluent-radio value="1">18-24</fluent-radio>
184
+ <fluent-radio value="2">25-33</fluent-radio>
185
+ <fluent-radio value="3">34-44</fluent-radio>
186
+ <fluent-radio value="4">45+</fluent-radio>
187
+ </fluent-radio-group>
188
+
189
+ {{ checked }}
190
+
191
+ <fluent-switch ng-observe="aria-checked" data-update="checked">
192
+ <span slot="checked-message">On</span>
193
+ <span slot="unchecked-message">Off</span>
194
+ <label for="cap-switch">Captions:</label>
195
+ </fluent-switch>
196
+ </body>
197
+ </html>
@@ -1,15 +1,17 @@
1
- export const scriptDirective = [
2
- "$templateCache",
3
- ($templateCache) => ({
1
+ scriptDirective.$inject = ["$templateCache"];
2
+
3
+ /**
4
+ * @param {import('../../core/cache/cache-factory').TemplateCache} $templateCache
5
+ * @returns {import('../../types').Directive}
6
+ */
7
+ export function scriptDirective($templateCache) {
8
+ return {
4
9
  restrict: "E",
5
10
  terminal: true,
6
11
  compile(element, attr) {
7
12
  if (attr.type === "text/ng-template") {
8
- const templateUrl = attr.id;
9
- const { text } = element[0];
10
-
11
- $templateCache.set(templateUrl, text);
13
+ $templateCache.set(attr.id, element[0].text);
12
14
  }
13
15
  },
14
- }),
15
- ];
16
+ };
17
+ }
@@ -33,33 +33,45 @@ import { startingTag } from "../../shared/jqlite/jqlite";
33
33
  */
34
34
  export const requiredDirective = [
35
35
  "$parse",
36
+ /**
37
+ * @param {import("../../core/parser/parse.js").ParseService} $parse
38
+ * @returns {import("../../types.js").Directive}
39
+ */
36
40
  ($parse) => ({
37
41
  restrict: "A",
38
42
  require: "?ngModel",
39
- link(scope, elm, attr, ctrl) {
40
- if (!ctrl) return;
41
- // For boolean attributes like required, presence means true
42
- let value =
43
- Object.prototype.hasOwnProperty.call(attr, "required") ||
44
- $parse(attr.ngRequired)(scope);
43
+ link:
44
+ /**
45
+ * @param {import("../../core/scope/scope.js").Scope} scope
46
+ * @param {*} _elm
47
+ * @param {import("../../types.js").Attributes} attr
48
+ * @param {import("../../types.js").NgModelController} ctrl
49
+ * @returns
50
+ */
51
+ (scope, _elm, attr, ctrl) => {
52
+ if (!ctrl) return;
53
+ // For boolean attributes like required, presence means true
54
+ let value =
55
+ Object.prototype.hasOwnProperty.call(attr, "required") ||
56
+ $parse(attr.ngRequired)(scope);
45
57
 
46
- if (!attr.ngRequired) {
47
- // force truthy in case we are on non input element
48
- // (input elements do this automatically for boolean attributes like required)
49
- attr.required = true;
50
- }
58
+ if (!attr.ngRequired) {
59
+ // force truthy in case we are on non input element
60
+ // (input elements do this automatically for boolean attributes like required)
61
+ attr.required = true;
62
+ }
51
63
 
52
- ctrl.$validators.required = function (modelValue, viewValue) {
53
- return !value || !ctrl.$isEmpty(viewValue);
54
- };
64
+ ctrl.$validators.required = (_modelValue, viewValue) => {
65
+ return !value || !ctrl.$isEmpty(viewValue);
66
+ };
55
67
 
56
- attr.$observe("required", (newVal) => {
57
- if (value !== newVal) {
58
- value = newVal;
59
- ctrl.$validate();
60
- }
61
- });
62
- },
68
+ attr.$observe("required", (newVal) => {
69
+ if (value !== newVal) {
70
+ value = newVal;
71
+ ctrl.$validate();
72
+ }
73
+ });
74
+ },
63
75
  }),
64
76
  ];
65
77
 
@@ -104,11 +116,15 @@ export const requiredDirective = [
104
116
  */
105
117
  export const patternDirective = [
106
118
  "$parse",
107
- function ($parse) {
119
+ /**
120
+ * @param {import("../../core/parser/parse.js").ParseService} $parse
121
+ * @returns {import("../../types.js").Directive}
122
+ */
123
+ ($parse) => {
108
124
  return {
109
125
  restrict: "A",
110
126
  require: "?ngModel",
111
- compile: function (tElm, tAttr) {
127
+ compile: (_Elm, tAttr) => {
112
128
  var patternExp;
113
129
  var parseFn;
114
130
 
@@ -201,30 +217,42 @@ export const patternDirective = [
201
217
  */
202
218
  export const maxlengthDirective = [
203
219
  "$parse",
220
+ /**
221
+ * @param {import("../../core/parser/parse.js").ParseService} $parse
222
+ * @returns {import("../../types.js").Directive}
223
+ */
204
224
  ($parse) => ({
205
225
  restrict: "A",
206
226
  require: "?ngModel",
207
- link(scope, elm, attr, ctrl) {
208
- if (!ctrl) return;
227
+ link:
228
+ /**
229
+ * @param {import("../../core/scope/scope.js").Scope} scope
230
+ * @param {*} _elm
231
+ * @param {import("../../types.js").Attributes} attr
232
+ * @param {import("../../types.js").NgModelController} ctrl
233
+ * @returns
234
+ */
235
+ (scope, _elm, attr, ctrl) => {
236
+ if (!ctrl) return;
209
237
 
210
- let maxlength = attr.maxlength || $parse(attr.ngMaxlength)(scope);
211
- let maxlengthParsed = parseLength(maxlength);
238
+ let maxlength = attr.maxlength || $parse(attr.ngMaxlength)(scope);
239
+ let maxlengthParsed = parseLength(maxlength);
212
240
 
213
- attr.$observe("maxlength", (value) => {
214
- if (maxlength !== value) {
215
- maxlengthParsed = parseLength(value);
216
- maxlength = value;
217
- ctrl.$validate();
218
- }
219
- });
220
- ctrl.$validators.maxlength = function (modelValue, viewValue) {
221
- return (
222
- maxlengthParsed < 0 ||
223
- ctrl.$isEmpty(viewValue) ||
224
- viewValue.length <= maxlengthParsed
225
- );
226
- };
227
- },
241
+ attr.$observe("maxlength", (value) => {
242
+ if (maxlength !== value) {
243
+ maxlengthParsed = parseLength(value);
244
+ maxlength = value;
245
+ ctrl.$validate();
246
+ }
247
+ });
248
+ ctrl.$validators.maxlength = function (modelValue, viewValue) {
249
+ return (
250
+ maxlengthParsed < 0 ||
251
+ ctrl.$isEmpty(viewValue) ||
252
+ viewValue.length <= maxlengthParsed
253
+ );
254
+ };
255
+ },
228
256
  }),
229
257
  ];
230
258
 
package/src/public.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $CompileProvider } from "./core/compile/compile";
1
+ import { CompileProvider } from "./core/compile/compile";
2
2
  import {
3
3
  inputDirective,
4
4
  ngValueDirective,
@@ -59,30 +59,27 @@ import {
59
59
  AnimateAsyncRunFactoryProvider,
60
60
  AnimateRunnerFactoryProvider,
61
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";
62
69
  import {
63
- TemplateCacheProvider,
64
- } from "./core/cache/cache-factory";
65
- import { $ControllerProvider } from "./core/controller/controller";
66
- import { $ExceptionHandlerProvider } from "./core/exception-handler";
67
- import { $FilterProvider } from "./core/filter/filter";
68
- import { $IntervalProvider } from "./core/interval/interval";
69
- import { $InterpolateProvider } from "./core/interpolate/interpolate";
70
- import { $$IntervalFactoryProvider } from "./core/interval/interval-factory";
71
- import {
72
- $HttpProvider,
73
- $HttpParamSerializerProvider,
74
- $HttpParamSerializerJQLikeProvider,
70
+ HttpProvider,
71
+ HttpParamSerializerProvider,
75
72
  } from "./services/http/http";
76
- import { $HttpBackendProvider } from "./services/http-backend/http-backend";
77
- import { $LocationProvider } from "./core/location/location";
78
- import { $LogProvider } from "./services/log";
79
- import { $ParseProvider } from "./core/parser/parse";
80
- import { $RootScopeProvider } from "./core/scope/scope";
81
- import { $QProvider, $$QProvider } from "./core/q/q";
82
- import { $SceProvider, $SceDelegateProvider } from "./core/sce/sce";
83
- import { $$TaskTrackerFactoryProvider } from "./core/task-tracker-factory";
73
+ import { HttpBackendProvider } from "./services/http-backend/http-backend";
74
+ import { LocationProvider } from "./core/location/location";
75
+ import { LogProvider } from "./services/log";
76
+ import { ParseProvider } from "./core/parser/parse";
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";
84
81
  import { TemplateRequestProvider } from "./services/template-request";
85
- import { $TimeoutProvider } from "./core/timeout/timeout";
82
+ import { TimeoutProvider } from "./core/timeout/timeout";
86
83
  import { SanitizeUriProvider } from "./core/sanitize/sanitize-uri";
87
84
  import {
88
85
  ngMessageDefaultDirective,
@@ -105,25 +102,25 @@ import {
105
102
  ngShowAriaDirective,
106
103
  ngValueAriaDirective,
107
104
  } from "./directive/aria/aria";
108
- import { $AnimateCssProvider } from "./animations/animate-css";
109
- import { $$AnimateQueueProvider } from "./animations/animate-queue";
110
- import { $$AnimateJsProvider } from "./animations/animate-js";
111
- import { $$AnimationProvider } from "./animations/animation";
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";
112
109
  import { RafSchedulerProvider } from "./animations/raf-scheduler";
113
- import { $$AnimateCacheProvider } from "./animations/animate-cache";
114
- import { $$AnimateCssDriverProvider } from "./animations/animate-css-driver";
115
- import { $$AnimateJsDriverProvider } from "./animations/animate-js-driver";
110
+ import { AnimateCacheProvider } from "./animations/animate-cache";
111
+ import { AnimateCssDriverProvider } from "./animations/animate-css-driver";
112
+ import { AnimateJsDriverProvider } from "./animations/animate-js-driver";
116
113
  import { ngAnimateSwapDirective } from "./animations/animate-swap";
117
114
  import { $$AnimateChildrenDirective } from "./animations/animate-children-directive";
118
115
  import { UrlConfigProvider } from "./router/url/url-config";
119
116
  import { UIRouterGlobals } from "./router/globals";
120
117
  import { ViewService } from "./router/view/view";
121
- import { TransitionService } from "./router/transition/transition-service";
122
- import { StateService } from "./router/state/state-service";
123
- import { $ViewScrollProvider } from "./router/view-scroll";
124
- import { TemplateFactory } from "./router/template-factory";
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";
125
122
  import { UrlService } from "./router/url/url-service";
126
- import { StateRegistry } from "./router/state/state-registry";
123
+ import { StateRegistryProvider } from "./router/state/state-registry";
127
124
  import { trace } from "./router/common/trace";
128
125
  import {
129
126
  $StateRefActiveDirective,
@@ -131,6 +128,7 @@ import {
131
128
  $StateRefDynamicDirective,
132
129
  } from "./router/directives/state-directives";
133
130
  import { $ViewDirectiveFill, ngView } from "./router/directives/view-directive";
131
+ import { ngObserveDirective } from "./directive/observe/observe";
134
132
 
135
133
  /**
136
134
  * @type {string} `version` from `package.json`, injected by Rollup plugin
@@ -155,7 +153,7 @@ export function publishExternalAPI(angular) {
155
153
  $$sanitizeUri: SanitizeUriProvider,
156
154
  });
157
155
  $provide
158
- .provider("$compile", $CompileProvider)
156
+ .provider("$compile", CompileProvider)
159
157
  .directive({
160
158
  input: inputDirective,
161
159
  textarea: inputDirective,
@@ -190,6 +188,7 @@ export function publishExternalAPI(angular) {
190
188
  ngSwitch: ngSwitchDirective,
191
189
  ngSwitchWhen: ngSwitchWhenDirective,
192
190
  ngSwitchDefault: ngSwitchDefaultDirective,
191
+ ngObserve: ngObserveDirective,
193
192
  ngOptions: ngOptionsDirective,
194
193
  ngTransclude: ngTranscludeDirective,
195
194
  ngModel: ngModelDirective,
@@ -236,48 +235,46 @@ export function publishExternalAPI(angular) {
236
235
  $aria: AriaProvider,
237
236
  $anchorScroll: AnchorScrollProvider,
238
237
  $animate: AnimateProvider,
239
- $$animation: $$AnimationProvider,
240
- $animateCss: $AnimateCssProvider,
241
- $$animateCssDriver: $$AnimateCssDriverProvider,
242
- $$animateJs: $$AnimateJsProvider,
243
- $$animateJsDriver: $$AnimateJsDriverProvider,
244
- $$animateCache: $$AnimateCacheProvider,
245
- $$animateQueue: $$AnimateQueueProvider,
238
+ $$animation: AnimationProvider,
239
+ $animateCss: AnimateCssProvider,
240
+ $$animateCssDriver: AnimateCssDriverProvider,
241
+ $$animateJs: AnimateJsProvider,
242
+ $$animateJsDriver: AnimateJsDriverProvider,
243
+ $$animateCache: AnimateCacheProvider,
244
+ $$animateQueue: AnimateQueueProvider,
246
245
  $$AnimateRunner: AnimateRunnerFactoryProvider,
247
246
  $$animateAsyncRun: AnimateAsyncRunFactoryProvider,
248
247
  $browser: BrowserProvider,
249
- $controller: $ControllerProvider,
250
- $exceptionHandler: $ExceptionHandlerProvider,
251
- $filter: $FilterProvider,
252
- $interpolate: $InterpolateProvider,
253
- $interval: $IntervalProvider,
254
- $$intervalFactory: $$IntervalFactoryProvider,
255
- $http: $HttpProvider,
256
- $httpParamSerializer: $HttpParamSerializerProvider,
257
- $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,
258
- $httpBackend: $HttpBackendProvider,
259
- $location: $LocationProvider,
260
- $log: $LogProvider,
261
- $parse: $ParseProvider,
248
+ $controller: ControllerProvider,
249
+ $exceptionHandler: ExceptionHandlerProvider,
250
+ $filter: FilterProvider,
251
+ $interpolate: InterpolateProvider,
252
+ $interval: IntervalProvider,
253
+ $$intervalFactory: $IntervalFactoryProvider,
254
+ $http: HttpProvider,
255
+ $httpParamSerializer: HttpParamSerializerProvider,
256
+ $httpBackend: HttpBackendProvider,
257
+ $location: LocationProvider,
258
+ $log: LogProvider,
259
+ $parse: ParseProvider,
262
260
  $$rAFScheduler: RafSchedulerProvider,
263
- $rootScope: $RootScopeProvider,
261
+ $rootScope: RootScopeProvider,
264
262
  $routerGlobals: UIRouterGlobals,
265
263
  $q: $QProvider,
266
- $$q: $$QProvider,
267
- $sce: $SceProvider,
268
- $sceDelegate: $SceDelegateProvider,
269
- $$taskTrackerFactory: $$TaskTrackerFactoryProvider,
264
+ $sce: SceProvider,
265
+ $sceDelegate: SceDelegateProvider,
266
+ $$taskTrackerFactory: TaskTrackerFactoryProvider,
270
267
  $templateCache: TemplateCacheProvider,
271
268
  $templateRequest: TemplateRequestProvider,
272
- $timeout: $TimeoutProvider,
269
+ $timeout: TimeoutProvider,
273
270
  $urlConfig: UrlConfigProvider,
274
271
  $view: ViewService,
275
- $transitions: TransitionService,
276
- $state: StateService,
277
- $ngViewScroll: $ViewScrollProvider,
278
- $templateFactory: TemplateFactory,
272
+ $transitions: TransitionProvider,
273
+ $state: StateProvider,
274
+ $ngViewScroll: ViewScrollProvider,
275
+ $templateFactory: TemplateFactoryProvider,
279
276
  $urlService: UrlService,
280
- $stateRegistry: StateRegistry,
277
+ $stateRegistry: StateRegistryProvider,
281
278
  });
282
279
  },
283
280
  ],
@@ -1,5 +1,4 @@
1
1
  import { filter, map, allTrueR, find } from "../../shared/common";
2
- import { prop } from "../../shared/hof";
3
2
  import { isInjectable } from "../../shared/predicates";
4
3
  import { isDefined, isUndefined, isString } from "../../shared/utils";
5
4
  import { services } from "../common/coreservices";
@@ -79,7 +78,7 @@ function getReplace(config, arrayMode, isOptional, squash) {
79
78
  ];
80
79
  const replace = Array.isArray(config.replace) ? config.replace : [];
81
80
  if (isString(squash)) replace.push({ from: squash, to: undefined });
82
- const configuredKeys = map(replace, prop("from"));
81
+ const configuredKeys = map(replace, (x) => x.from);
83
82
  return filter(
84
83
  defaultPolicy,
85
84
  (item) => configuredKeys.indexOf(item.from) === -1,
@@ -25,9 +25,11 @@ export class PathNode {
25
25
  this.resolvables = state.resolvables.map((res) => res.clone());
26
26
  }
27
27
  }
28
+
28
29
  clone() {
29
30
  return new PathNode(this);
30
31
  }
32
+
31
33
  /** Sets [[paramValues]] for the node, from the values of an object hash */
32
34
  applyRawParams(params) {
33
35
  const getParamVal = (paramDef) => [
@@ -40,10 +42,12 @@ export class PathNode {
40
42
  );
41
43
  return this;
42
44
  }
45
+
43
46
  /** Gets a specific [[Param]] metadata that belongs to the node */
44
47
  parameter(name) {
45
48
  return find(this.paramSchema, propEq("id", name));
46
49
  }
50
+
47
51
  /**
48
52
  * @returns true if the state and parameter values for another PathNode are
49
53
  * equal to the state and param values for this PathNode
@@ -52,6 +56,7 @@ export class PathNode {
52
56
  const diff = this.diff(node, paramsFn);
53
57
  return diff && diff.length === 0;
54
58
  }
59
+
55
60
  /**
56
61
  * Finds Params with different parameter values on another PathNode.
57
62
  *
@@ -70,8 +75,3 @@ export class PathNode {
70
75
  return Param.changed(params, this.paramValues, node.paramValues);
71
76
  }
72
77
  }
73
- /**
74
- * Returns a clone of the PathNode
75
- * @deprecated use instance method `node.clone()`
76
- */
77
- PathNode.clone = (node) => node.clone();