@angular-wave/angular.ts 0.0.37 → 0.0.39
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.
- package/Makefile +6 -5
- package/dist/angular-ts.esm.js +2 -1
- package/dist/angular-ts.umd.js +1 -1
- package/package.json +2 -4
- package/rollup.config.js +5 -1
- package/src/binding.spec.js +4 -4
- package/src/core/location/location.js +1 -1
- package/src/core/scope/scope.js +4 -7
- package/src/exts/aria/aria.html +1 -4
- package/src/exts/messages/messages.html +1 -4
- package/src/index.js +307 -1
- package/src/loader.js +13 -6
- package/src/public.js +7 -2
- package/src/router/directives/directives.test.js +19 -0
- package/src/router/directives/state-directives.html +21 -0
- package/src/router/{state-directives.spec.js → directives/state-directives.spec.js} +2 -1
- package/src/router/{view-directive.spec.js → directives/view-directive.spec.js} +2 -1
- package/src/router/directives/view-directives.html +21 -0
- package/src/router/router.html +22 -0
- package/src/router/router.test.js +11 -0
- package/src/router/services.spec.js +2 -2
- package/src/router/{state-builder.spec.js → state/state-builder.spec.js} +9 -12
- package/src/router/state/state.html +22 -0
- package/src/router/{state.spec.js → state/state.spec.js} +1 -1
- package/src/router/state/state.test.js +11 -0
- package/src/router/state-filter.spec.js +2 -2
- package/src/router/template-factory.spec.js +4 -4
- package/src/router/url/url.html +18 -0
- package/src/router/url/url.test.js +11 -0
- package/src/router/view/view.html +18 -0
- package/src/router/{view.spec.js → view/view.spec.js} +1 -1
- package/src/router/view/view.test.js +11 -0
- package/src/router/view-hook.spec.js +4 -4
- package/src/router/view-scroll.spec.js +4 -4
- package/src/services/http/http.html +22 -0
- package/src/services/http/http.test.js +11 -0
- package/src/services/http-backend/http-backend.html +21 -0
- package/src/services/http-backend/http-backend.js +1 -1
- package/src/services/http-backend/http-backend.spec.js +1 -1
- package/src/services/http-backend/http-backend.test.js +11 -0
- package/src/shared/common.spec.js +4 -4
- package/src/shared/hof.spec.js +1 -1
- package/src/shared/min-err.spec.js +2 -2
- package/src/shared/shared.html +22 -0
- package/src/shared/shared.test.js +11 -0
- package/src/shared/test-utils.js +2 -2
- package/src/shared/utils.spec.js +1 -1
- package/src/src.html +22 -0
- package/src/src.test.js +10 -0
- package/tsconfig.json +1 -1
- package/tsconfig.types.json +11 -0
- package/types/animations/animate-cache.d.ts +7 -7
- package/types/animations/animate-children-directive.d.ts +3 -6
- package/types/animations/animate-swap.d.ts +7 -16
- package/types/animations/animation.d.ts +2 -11
- package/types/animations/raf-scheduler.d.ts +3 -3
- package/types/animations/shared.d.ts +8 -23
- package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
- package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
- package/types/core/compile/compile.d.ts +173 -0
- package/types/core/controller/controller.d.ts +32 -0
- package/types/core/exception-handler.d.ts +1 -1
- package/types/core/filter/filter.d.ts +9 -0
- package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
- package/types/core/interval/interval-factory.d.ts +4 -0
- package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
- package/types/core/location/location.d.ts +209 -0
- package/types/core/pubsub/pubsub.d.ts +156 -0
- package/types/core/q/q.d.ts +31 -0
- package/types/core/sanitize/sanitize-uri.d.ts +53 -0
- package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
- package/types/core/scope/scope.d.ts +727 -0
- package/types/core/task-tracker-factory.d.ts +29 -29
- package/types/core/timeout/timeout.d.ts +20 -0
- package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
- package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
- package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
- package/types/directive/controller/controller.d.ts +6 -0
- package/types/directive/events/events.d.ts +5 -0
- package/types/directive/form/form.d.ts +200 -0
- package/types/directive/if/if.d.ts +8 -0
- package/types/directive/include/include.d.ts +14 -0
- package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
- package/types/directive/{model.d.ts → model/model.d.ts} +256 -279
- package/types/directive/options/options.d.ts +9 -0
- package/types/directive/ref/ref.d.ts +5 -0
- package/types/directive/repeat/repeat.d.ts +8 -0
- package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
- package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
- package/types/directive/switch/switch.d.ts +17 -0
- package/types/directive/transclude/transclude.d.ts +4 -0
- package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
- package/types/filters/filters.d.ts +10 -16
- package/types/filters/order-by.d.ts +2 -4
- package/types/index.d.ts +117 -0
- package/types/injector.d.ts +12 -0
- package/types/public.d.ts +5 -0
- package/types/router/common/coreservices.d.ts +2 -2
- package/types/router/common/glob.d.ts +9 -9
- package/types/router/common/queue.d.ts +13 -13
- package/types/router/common/trace.d.ts +43 -43
- package/types/router/directives/view-directive.d.ts +13 -32
- package/types/router/globals.d.ts +20 -20
- package/types/router/hooks/lazy-load.d.ts +2 -11
- package/types/router/hooks/redirect-to.d.ts +1 -4
- package/types/router/hooks/url.d.ts +1 -5
- package/types/router/hooks/views.d.ts +1 -4
- package/types/router/params/param-factory.d.ts +5 -5
- package/types/router/params/param-type.d.ts +35 -35
- package/types/router/params/param-types.d.ts +11 -11
- package/types/router/params/param.d.ts +38 -38
- package/types/router/params/state-params.d.ts +10 -10
- package/types/router/path/path-node.d.ts +34 -34
- package/types/router/path/path-utils.d.ts +73 -77
- package/types/router/resolve/resolvable.d.ts +32 -32
- package/types/router/resolve/resolve-context.d.ts +84 -84
- package/types/router/services.d.ts +4 -9
- package/types/router/state/state-builder.d.ts +27 -27
- package/types/router/state/state-matcher.d.ts +5 -5
- package/types/router/state/state-object.d.ts +58 -58
- package/types/router/state/state-queue-manager.d.ts +10 -16
- package/types/router/state/state-registry.d.ts +100 -107
- package/types/router/state/state-service.d.ts +411 -411
- package/types/router/state/target-state.d.ts +64 -69
- package/types/router/state/views.d.ts +31 -37
- package/types/router/state-filters.d.ts +7 -7
- package/types/router/state-provider.d.ts +105 -105
- package/types/router/template-factory.d.ts +83 -112
- package/types/router/transition/hook-builder.d.ts +25 -25
- package/types/router/transition/hook-registry.d.ts +68 -83
- package/types/router/transition/interface.d.ts +7 -7
- package/types/router/transition/reject-factory.d.ts +34 -34
- package/types/router/transition/transition-event-type.d.ts +9 -18
- package/types/router/transition/transition-hook.d.ts +77 -82
- package/types/router/transition/transition-service.d.ts +82 -99
- package/types/router/transition/transition.d.ts +369 -377
- package/types/router/url/url-config.d.ts +84 -84
- package/types/router/url/url-matcher.d.ts +115 -119
- package/types/router/url/url-rule.d.ts +114 -124
- package/types/router/url/url-rules.d.ts +217 -217
- package/types/router/url/url-service.d.ts +264 -269
- package/types/router/view/view.d.ts +114 -117
- package/types/router/view-scroll.d.ts +2 -2
- package/types/services/anchor-scroll.d.ts +2 -8
- package/types/services/browser.d.ts +122 -130
- package/types/services/cache-factory.d.ts +25 -25
- package/types/services/cookie-reader.d.ts +2 -2
- package/types/services/document.d.ts +2 -2
- package/types/services/http/http.d.ts +145 -0
- package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
- package/types/services/log.d.ts +49 -49
- package/types/services/template-request.d.ts +44 -53
- package/types/shared/common.d.ts +4 -19
- package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
- package/types/shared/hof.d.ts +1 -1
- package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +11 -11
- package/types/shared/test-utils.d.ts +11 -0
- package/types/shared/utils.d.ts +7 -24
- package/types-back/global.d.ts +3 -1
- package/types-back/index.d.ts +2 -221
- package/types/core/compile.d.ts +0 -206
- package/types/core/controller.d.ts +0 -42
- package/types/core/filter.d.ts +0 -9
- package/types/core/interval-factory.d.ts +0 -21
- package/types/core/location.d.ts +0 -234
- package/types/core/pubsub.d.ts +0 -164
- package/types/core/q.d.ts +0 -33
- package/types/core/root-scope.d.ts +0 -754
- package/types/core/sanitize-uri.d.ts +0 -57
- package/types/core/timeout.d.ts +0 -31
- package/types/directive/controller.d.ts +0 -6
- package/types/directive/events.d.ts +0 -12
- package/types/directive/form.d.ts +0 -230
- package/types/directive/if.d.ts +0 -17
- package/types/directive/include.d.ts +0 -33
- package/types/directive/options.d.ts +0 -16
- package/types/directive/ref.d.ts +0 -11
- package/types/directive/repeat.d.ts +0 -23
- package/types/directive/switch.d.ts +0 -23
- package/types/directive/transclude.d.ts +0 -15
- package/types/services/http.d.ts +0 -157
- /package/src/router/{url-service.spec.js → url/url-service.spec.js} +0 -0
- /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
- /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
- /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
- /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
- /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
- /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
- /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
- /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
- /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
|
@@ -4,416 +4,416 @@
|
|
|
4
4
|
* This API is located at `router.stateService` ([[UIRouter.stateService]])
|
|
5
5
|
*/
|
|
6
6
|
export class StateService {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
7
|
+
static $inject: string[];
|
|
8
|
+
constructor(globals: any, transitionService: any);
|
|
9
|
+
/**
|
|
10
|
+
* The latest successful state parameters
|
|
11
|
+
*
|
|
12
|
+
* @deprecated This is a passthrough through to [[UIRouterGlobals.params]]
|
|
13
|
+
*/
|
|
14
|
+
get params(): any;
|
|
15
|
+
/**
|
|
16
|
+
* The current [[StateDeclaration]]
|
|
17
|
+
*
|
|
18
|
+
* @deprecated This is a passthrough through to [[UIRouterGlobals.current]]
|
|
19
|
+
*/
|
|
20
|
+
get current(): any;
|
|
21
|
+
/**
|
|
22
|
+
* The current [[StateObject]] (an internal API)
|
|
23
|
+
*
|
|
24
|
+
* @deprecated This is a passthrough through to [[UIRouterGlobals.$current]]
|
|
25
|
+
*/
|
|
26
|
+
get $current(): any;
|
|
27
|
+
stateRegistry: any;
|
|
28
|
+
urlService: any;
|
|
29
|
+
globals: any;
|
|
30
|
+
transitionService: any;
|
|
31
|
+
invalidCallbacks: any[];
|
|
32
|
+
_defaultErrorHandler: ($error$: any) => never;
|
|
33
|
+
$get: (() => this)[];
|
|
34
|
+
/**
|
|
35
|
+
* Decorates states when they are registered
|
|
36
|
+
*
|
|
37
|
+
* Allows you to extend (carefully) or override (at your own peril) the
|
|
38
|
+
* `stateBuilder` object used internally by [[StateRegistry]].
|
|
39
|
+
* This can be used to add custom functionality to ui-router,
|
|
40
|
+
* for example inferring templateUrl based on the state name.
|
|
41
|
+
*
|
|
42
|
+
* When passing only a name, it returns the current (original or decorated) builder
|
|
43
|
+
* function that matches `name`.
|
|
44
|
+
*
|
|
45
|
+
* The builder functions that can be decorated are listed below. Though not all
|
|
46
|
+
* necessarily have a good use case for decoration, that is up to you to decide.
|
|
47
|
+
*
|
|
48
|
+
* In addition, users can attach custom decorators, which will generate new
|
|
49
|
+
* properties within the state's internal definition. There is currently no clear
|
|
50
|
+
* use-case for this beyond accessing internal states (i.e. $state.$current),
|
|
51
|
+
* however, expect this to become increasingly relevant as we introduce additional
|
|
52
|
+
* meta-programming features.
|
|
53
|
+
*
|
|
54
|
+
* **Warning**: Decorators should not be interdependent because the order of
|
|
55
|
+
* execution of the builder functions in non-deterministic. Builder functions
|
|
56
|
+
* should only be dependent on the state definition object and super function.
|
|
57
|
+
*
|
|
58
|
+
*
|
|
59
|
+
* Existing builder functions and current return values:
|
|
60
|
+
*
|
|
61
|
+
* - **parent** `{object}` - returns the parent state object.
|
|
62
|
+
* - **data** `{object}` - returns state data, including any inherited data that is not
|
|
63
|
+
* overridden by own values (if any).
|
|
64
|
+
* - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
|
|
65
|
+
* or `null`.
|
|
66
|
+
* - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
|
|
67
|
+
* navigable).
|
|
68
|
+
* - **params** `{object}` - returns an array of state params that are ensured to
|
|
69
|
+
* be a super-set of parent's params.
|
|
70
|
+
* - **views** `{object}` - returns a views object where each key is an absolute view
|
|
71
|
+
* name (i.e. "viewName@stateName") and each value is the config object
|
|
72
|
+
* (template, controller) for the view. Even when you don't use the views object
|
|
73
|
+
* explicitly on a state config, one is still created for you internally.
|
|
74
|
+
* So by decorating this builder function you have access to decorating template
|
|
75
|
+
* and controller properties.
|
|
76
|
+
* - **ownParams** `{object}` - returns an array of params that belong to the state,
|
|
77
|
+
* not including any params defined by ancestor states.
|
|
78
|
+
* - **path** `{string}` - returns the full path from the root down to this state.
|
|
79
|
+
* Needed for state activation.
|
|
80
|
+
* - **includes** `{object}` - returns an object that includes every state that
|
|
81
|
+
* would pass a `$state.includes()` test.
|
|
82
|
+
*
|
|
83
|
+
* #### Example:
|
|
84
|
+
* Override the internal 'views' builder with a function that takes the state
|
|
85
|
+
* definition, and a reference to the internal function being overridden:
|
|
86
|
+
* ```js
|
|
87
|
+
* $stateProvider.decorator('views', function (state, parent) {
|
|
88
|
+
* let result = {},
|
|
89
|
+
* views = parent(state);
|
|
90
|
+
*
|
|
91
|
+
* angular.forEach(views, function (config, name) {
|
|
92
|
+
* let autoName = (state.name + '.' + name).replace('.', '/');
|
|
93
|
+
* config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
|
|
94
|
+
* result[name] = config;
|
|
95
|
+
* });
|
|
96
|
+
* return result;
|
|
97
|
+
* });
|
|
98
|
+
*
|
|
99
|
+
* $stateProvider.state('home', {
|
|
100
|
+
* views: {
|
|
101
|
+
* 'contact.list': { controller: 'ListController' },
|
|
102
|
+
* 'contact.item': { controller: 'ItemController' }
|
|
103
|
+
* }
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
*
|
|
108
|
+
* ```js
|
|
109
|
+
* // Auto-populates list and item views with /partials/home/contact/list.html,
|
|
110
|
+
* // and /partials/home/contact/item.html, respectively.
|
|
111
|
+
* $state.go('home');
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @param {string} name The name of the builder function to decorate.
|
|
115
|
+
* @param {object} func A function that is responsible for decorating the original
|
|
116
|
+
* builder function. The function receives two parameters:
|
|
117
|
+
*
|
|
118
|
+
* - `{object}` - state - The state config object.
|
|
119
|
+
* - `{object}` - super - The original builder function.
|
|
120
|
+
*
|
|
121
|
+
* @return {object} $stateProvider - $stateProvider instance
|
|
122
|
+
*/
|
|
123
|
+
decorator(name: string, func: object): object;
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
* @param {angular.Ng1StateDeclaration} definition
|
|
127
|
+
*/
|
|
128
|
+
state(definition: angular.Ng1StateDeclaration): this;
|
|
129
|
+
/**
|
|
130
|
+
* Registers an invalid state handler
|
|
131
|
+
*
|
|
132
|
+
* This is a passthrough to [[StateService.onInvalid]] for ng1.
|
|
133
|
+
*/
|
|
134
|
+
onInvalid(callback: any): any;
|
|
135
|
+
/**
|
|
136
|
+
* Registers an Invalid State handler
|
|
137
|
+
*
|
|
138
|
+
* Registers a [[OnInvalidCallback]] function to be invoked when [[StateService.transitionTo]]
|
|
139
|
+
* has been called with an invalid state reference parameter
|
|
140
|
+
*
|
|
141
|
+
* Example:
|
|
142
|
+
* ```js
|
|
143
|
+
* stateService.onInvalid(function(to, from, injector) {
|
|
144
|
+
* if (to.name() === 'foo') {
|
|
145
|
+
* let lazyLoader = injector.get('LazyLoadService');
|
|
146
|
+
* return lazyLoader.load('foo')
|
|
147
|
+
* .then(() => stateService.target('foo'));
|
|
148
|
+
* }
|
|
149
|
+
* });
|
|
150
|
+
* ```
|
|
151
|
+
*
|
|
152
|
+
* @param {function} callback invoked when the toState is invalid
|
|
153
|
+
* This function receives the (invalid) toState, the fromState, and an injector.
|
|
154
|
+
* The function may optionally return a [[TargetState]] or a Promise for a TargetState.
|
|
155
|
+
* If one is returned, it is treated as a redirect.
|
|
156
|
+
*
|
|
157
|
+
* @returns a function which deregisters the callback
|
|
158
|
+
*/
|
|
159
|
+
onInvalid(callback: Function): any;
|
|
160
|
+
/**
|
|
161
|
+
* Handler for when [[transitionTo]] is called with an invalid state.
|
|
162
|
+
*
|
|
163
|
+
* Invokes the [[onInvalid]] callbacks, in natural order.
|
|
164
|
+
* Each callback's return value is checked in sequence until one of them returns an instance of TargetState.
|
|
165
|
+
* The results of the callbacks are wrapped in $q.when(), so the callbacks may return promises.
|
|
166
|
+
*
|
|
167
|
+
* If a callback returns an TargetState, then it is used as arguments to $state.transitionTo() and the result returned.
|
|
168
|
+
*
|
|
169
|
+
* @internal
|
|
170
|
+
*/
|
|
171
|
+
_handleInvalidTargetState(fromPath: any, toState: any): any;
|
|
172
|
+
/**
|
|
173
|
+
* Reloads the current state
|
|
174
|
+
*
|
|
175
|
+
* A method that force reloads the current state, or a partial state hierarchy.
|
|
176
|
+
* All resolves are re-resolved, and components reinstantiated.
|
|
177
|
+
*
|
|
178
|
+
* #### Example:
|
|
179
|
+
* ```js
|
|
180
|
+
* let app angular.module('app', ['ui.router']);
|
|
181
|
+
*
|
|
182
|
+
* app.controller('ctrl', function ($scope, $state) {
|
|
183
|
+
* $scope.reload = function(){
|
|
184
|
+
* $state.reload();
|
|
185
|
+
* }
|
|
186
|
+
* });
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* Note: `reload()` is just an alias for:
|
|
190
|
+
*
|
|
191
|
+
* ```js
|
|
192
|
+
* $state.transitionTo($state.current, $state.params, {
|
|
193
|
+
* reload: true, inherit: false
|
|
194
|
+
* });
|
|
195
|
+
* ```
|
|
196
|
+
*
|
|
197
|
+
* @param reloadState A state name or a state object.
|
|
198
|
+
* If present, this state and all its children will be reloaded, but ancestors will not reload.
|
|
199
|
+
*
|
|
200
|
+
* #### Example:
|
|
201
|
+
* ```js
|
|
202
|
+
* //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item'
|
|
203
|
+
* //and current state is 'contacts.detail.item'
|
|
204
|
+
* let app angular.module('app', ['ui.router']);
|
|
205
|
+
*
|
|
206
|
+
* app.controller('ctrl', function ($scope, $state) {
|
|
207
|
+
* $scope.reload = function(){
|
|
208
|
+
* //will reload 'contact.detail' and nested 'contact.detail.item' states
|
|
209
|
+
* $state.reload('contact.detail');
|
|
210
|
+
* }
|
|
211
|
+
* });
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
* @returns A promise representing the state of the new transition. See [[StateService.go]]
|
|
215
|
+
*/
|
|
216
|
+
reload(reloadState: any): any;
|
|
217
|
+
/**
|
|
218
|
+
* Transition to a different state and/or parameters
|
|
219
|
+
*
|
|
220
|
+
* Convenience method for transitioning to a new state.
|
|
221
|
+
*
|
|
222
|
+
* `$state.go` calls `$state.transitionTo` internally but automatically sets options to
|
|
223
|
+
* `{ location: true, inherit: true, relative: router.globals.$current, notify: true }`.
|
|
224
|
+
* This allows you to use either an absolute or relative `to` argument (because of `relative: router.globals.$current`).
|
|
225
|
+
* It also allows you to specify * only the parameters you'd like to update, while letting unspecified parameters
|
|
226
|
+
* inherit from the current parameter values (because of `inherit: true`).
|
|
227
|
+
*
|
|
228
|
+
* #### Example:
|
|
229
|
+
* ```js
|
|
230
|
+
* let app = angular.module('app', ['ui.router']);
|
|
231
|
+
*
|
|
232
|
+
* app.controller('ctrl', function ($scope, $state) {
|
|
233
|
+
* $scope.changeState = function () {
|
|
234
|
+
* $state.go('contact.detail');
|
|
235
|
+
* };
|
|
236
|
+
* });
|
|
237
|
+
* ```
|
|
238
|
+
*
|
|
239
|
+
* @param to Absolute state name, state object, or relative state path (relative to current state).
|
|
240
|
+
*
|
|
241
|
+
* Some examples:
|
|
242
|
+
*
|
|
243
|
+
* - `$state.go('contact.detail')` - will go to the `contact.detail` state
|
|
244
|
+
* - `$state.go('^')` - will go to the parent state
|
|
245
|
+
* - `$state.go('^.sibling')` - if current state is `home.child`, will go to the `home.sibling` state
|
|
246
|
+
* - `$state.go('.child.grandchild')` - if current state is home, will go to the `home.child.grandchild` state
|
|
247
|
+
*
|
|
248
|
+
* @param params A map of the parameters that will be sent to the state, will populate $stateParams.
|
|
249
|
+
*
|
|
250
|
+
* Any parameters that are not specified will be inherited from current parameter values (because of `inherit: true`).
|
|
251
|
+
* This allows, for example, going to a sibling state that shares parameters defined by a parent state.
|
|
252
|
+
*
|
|
253
|
+
* @param options Transition options
|
|
254
|
+
*
|
|
255
|
+
* @returns {promise} A promise representing the state of the new transition.
|
|
256
|
+
*/
|
|
257
|
+
go(to: any, params: any, options: any): Promise<any>;
|
|
258
|
+
/**
|
|
259
|
+
* Creates a [[TargetState]]
|
|
260
|
+
*
|
|
261
|
+
* This is a factory method for creating a TargetState
|
|
262
|
+
*
|
|
263
|
+
* This may be returned from a Transition Hook to redirect a transition, for example.
|
|
264
|
+
*/
|
|
265
|
+
target(identifier: any, params: any, options?: {}): TargetState;
|
|
266
|
+
getCurrentPath(): any;
|
|
267
|
+
/**
|
|
268
|
+
* Low-level method for transitioning to a new state.
|
|
269
|
+
*
|
|
270
|
+
* The [[go]] method (which uses `transitionTo` internally) is recommended in most situations.
|
|
271
|
+
*
|
|
272
|
+
* #### Example:
|
|
273
|
+
* ```js
|
|
274
|
+
* let app = angular.module('app', ['ui.router']);
|
|
275
|
+
*
|
|
276
|
+
* app.controller('ctrl', function ($scope, $state) {
|
|
277
|
+
* $scope.changeState = function () {
|
|
278
|
+
* $state.transitionTo('contact.detail');
|
|
279
|
+
* };
|
|
280
|
+
* });
|
|
281
|
+
* ```
|
|
282
|
+
*
|
|
283
|
+
* @param to State name or state object.
|
|
284
|
+
* @param toParams A map of the parameters that will be sent to the state,
|
|
285
|
+
* will populate $stateParams.
|
|
286
|
+
* @param options Transition options
|
|
287
|
+
*
|
|
288
|
+
* @returns A promise representing the state of the new transition. See [[go]]
|
|
289
|
+
*/
|
|
290
|
+
transitionTo(to: any, toParams?: {}, options?: {}): any;
|
|
291
|
+
/**
|
|
292
|
+
* Checks if the current state *is* the provided state
|
|
293
|
+
*
|
|
294
|
+
* Similar to [[includes]] but only checks for the full state name.
|
|
295
|
+
* If params is supplied then it will be tested for strict equality against the current
|
|
296
|
+
* active params object, so all params must match with none missing and no extras.
|
|
297
|
+
*
|
|
298
|
+
* #### Example:
|
|
299
|
+
* ```js
|
|
300
|
+
* $state.$current.name = 'contacts.details.item';
|
|
301
|
+
*
|
|
302
|
+
* // absolute name
|
|
303
|
+
* $state.is('contact.details.item'); // returns true
|
|
304
|
+
* $state.is(contactDetailItemStateObject); // returns true
|
|
305
|
+
* ```
|
|
306
|
+
*
|
|
307
|
+
* // relative name (. and ^), typically from a template
|
|
308
|
+
* // E.g. from the 'contacts.details' template
|
|
309
|
+
* ```html
|
|
310
|
+
* <div ng-class="{highlighted: $state.is('.item')}">Item</div>
|
|
311
|
+
* ```
|
|
312
|
+
*
|
|
313
|
+
* @param stateOrName The state name (absolute or relative) or state object you'd like to check.
|
|
314
|
+
* @param params A param object, e.g. `{sectionId: section.id}`, that you'd like
|
|
315
|
+
* to test against the current active state.
|
|
316
|
+
* @param options An options object. The options are:
|
|
317
|
+
* - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will
|
|
318
|
+
* test relative to `options.relative` state (or name).
|
|
319
|
+
*
|
|
320
|
+
* @returns Returns true if it is the state.
|
|
321
|
+
*/
|
|
322
|
+
is(stateOrName: any, params: any, options: any): boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Checks if the current state *includes* the provided state
|
|
325
|
+
*
|
|
326
|
+
* A method to determine if the current active state is equal to or is the child of the
|
|
327
|
+
* state stateName. If any params are passed then they will be tested for a match as well.
|
|
328
|
+
* Not all the parameters need to be passed, just the ones you'd like to test for equality.
|
|
329
|
+
*
|
|
330
|
+
* #### Example when `$state.$current.name === 'contacts.details.item'`
|
|
331
|
+
* ```js
|
|
332
|
+
* // Using partial names
|
|
333
|
+
* $state.includes("contacts"); // returns true
|
|
334
|
+
* $state.includes("contacts.details"); // returns true
|
|
335
|
+
* $state.includes("contacts.details.item"); // returns true
|
|
336
|
+
* $state.includes("contacts.list"); // returns false
|
|
337
|
+
* $state.includes("about"); // returns false
|
|
338
|
+
* ```
|
|
339
|
+
*
|
|
340
|
+
* #### Glob Examples when `* $state.$current.name === 'contacts.details.item.url'`:
|
|
341
|
+
* ```js
|
|
342
|
+
* $state.includes("*.details.*.*"); // returns true
|
|
343
|
+
* $state.includes("*.details.**"); // returns true
|
|
344
|
+
* $state.includes("**.item.**"); // returns true
|
|
345
|
+
* $state.includes("*.details.item.url"); // returns true
|
|
346
|
+
* $state.includes("*.details.*.url"); // returns true
|
|
347
|
+
* $state.includes("*.details.*"); // returns false
|
|
348
|
+
* $state.includes("item.**"); // returns false
|
|
349
|
+
* ```
|
|
350
|
+
*
|
|
351
|
+
* @param stateOrName A partial name, relative name, glob pattern,
|
|
352
|
+
* or state object to be searched for within the current state name.
|
|
353
|
+
* @param params A param object, e.g. `{sectionId: section.id}`,
|
|
354
|
+
* that you'd like to test against the current active state.
|
|
355
|
+
* @param options An options object. The options are:
|
|
356
|
+
* - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will
|
|
357
|
+
* test relative to `options.relative` state (or name).
|
|
358
|
+
*
|
|
359
|
+
* @returns {boolean} Returns true if it does include the state
|
|
360
|
+
*/
|
|
361
|
+
includes(stateOrName: any, params: any, options: any): boolean;
|
|
362
|
+
/**
|
|
363
|
+
* Generates a URL for a state and parameters
|
|
364
|
+
*
|
|
365
|
+
* Returns the url for the given state populated with the given params.
|
|
366
|
+
*
|
|
367
|
+
* #### Example:
|
|
368
|
+
* ```js
|
|
369
|
+
* expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob");
|
|
370
|
+
* ```
|
|
371
|
+
*
|
|
372
|
+
* @param stateOrName The state name or state object you'd like to generate a url from.
|
|
373
|
+
* @param params An object of parameter values to fill the state's required parameters.
|
|
374
|
+
* @param options Options object. The options are:
|
|
375
|
+
*
|
|
376
|
+
* @returns {string} compiled state url
|
|
377
|
+
*/
|
|
378
|
+
href(stateOrName: any, params: any, options: any): string;
|
|
379
|
+
/**
|
|
380
|
+
* Sets or gets the default [[transitionTo]] error handler.
|
|
381
|
+
*
|
|
382
|
+
* The error handler is called when a [[Transition]] is rejected or when any error occurred during the Transition.
|
|
383
|
+
* This includes errors caused by resolves and transition hooks.
|
|
384
|
+
*
|
|
385
|
+
* Note:
|
|
386
|
+
* This handler does not receive certain Transition rejections.
|
|
387
|
+
* Redirected and Ignored Transitions are not considered to be errors by [[StateService.transitionTo]].
|
|
388
|
+
*
|
|
389
|
+
* The built-in default error handler logs the error to the console.
|
|
390
|
+
*
|
|
391
|
+
* You can provide your own custom handler.
|
|
392
|
+
*
|
|
393
|
+
* #### Example:
|
|
394
|
+
* ```js
|
|
395
|
+
* stateService.defaultErrorHandler(function() {
|
|
396
|
+
* // Do not log transitionTo errors
|
|
397
|
+
* });
|
|
398
|
+
* ```
|
|
399
|
+
*
|
|
400
|
+
* @param handler a global error handler function
|
|
401
|
+
* @returns the current global error handler
|
|
402
|
+
*/
|
|
403
|
+
defaultErrorHandler(handler: any): any;
|
|
404
|
+
get(stateOrName: any, base: any, ...args: any[]): any;
|
|
405
|
+
/**
|
|
406
|
+
* Lazy loads a state
|
|
407
|
+
*
|
|
408
|
+
* Explicitly runs a state's [[StateDeclaration.lazyLoad]] function.
|
|
409
|
+
*
|
|
410
|
+
* @param stateOrName the state that should be lazy loaded
|
|
411
|
+
* @param transition the optional Transition context to use (if the lazyLoad function requires an injector, etc)
|
|
412
|
+
* Note: If no transition is provided, a noop transition is created using the from the current state to the current state.
|
|
413
|
+
* This noop transition is not actually run.
|
|
414
|
+
*
|
|
415
|
+
* @returns a promise to lazy load
|
|
416
|
+
*/
|
|
417
|
+
lazyLoad(stateOrName: any, transition: any): any;
|
|
418
418
|
}
|
|
419
419
|
import { TargetState } from "./target-state";
|