@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
|
@@ -2,275 +2,270 @@
|
|
|
2
2
|
* API for URL management
|
|
3
3
|
*/
|
|
4
4
|
export class UrlService {
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
* @param object The object to perform the type check against.
|
|
270
|
-
* @returns `true` if the object matches the `UrlMatcher` interface, by
|
|
271
|
-
* implementing all the same methods.
|
|
272
|
-
*/
|
|
273
|
-
isMatcher(object: any): boolean;
|
|
5
|
+
static $inject: string[];
|
|
6
|
+
/**
|
|
7
|
+
* @param {angular.ILocationProvider} $locationProvider
|
|
8
|
+
*/
|
|
9
|
+
constructor($locationProvider: angular.ILocationProvider, stateService: any, globals: any, urlConfigProvider: any);
|
|
10
|
+
stateService: any;
|
|
11
|
+
$locationProvider: angular.ILocationProvider;
|
|
12
|
+
$location: any;
|
|
13
|
+
$browser: any;
|
|
14
|
+
/** @type {boolean} */
|
|
15
|
+
interceptDeferred: boolean;
|
|
16
|
+
/** Provides services related to the URL */
|
|
17
|
+
urlRuleFactory: UrlRuleFactory;
|
|
18
|
+
/**
|
|
19
|
+
* The nested [[UrlRules]] API for managing URL rules and rewrites
|
|
20
|
+
*
|
|
21
|
+
* See: [[UrlRules]] for details
|
|
22
|
+
* @type {UrlRules}
|
|
23
|
+
*/
|
|
24
|
+
rules: UrlRules;
|
|
25
|
+
/**
|
|
26
|
+
* The nested [[UrlConfig]] API to configure the URL and retrieve URL information
|
|
27
|
+
*
|
|
28
|
+
* See: [[UrlConfig]] for details
|
|
29
|
+
* @type {angular.UrlConfig}
|
|
30
|
+
*/
|
|
31
|
+
config: angular.UrlConfig;
|
|
32
|
+
/** Creates a new [[Param]] for a given location (DefType) */
|
|
33
|
+
paramFactory: ParamFactory;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the path part of the current url
|
|
36
|
+
*
|
|
37
|
+
* If the current URL is `/some/path?query=value#anchor`, this returns `/some/path`
|
|
38
|
+
*
|
|
39
|
+
* @return the path portion of the url
|
|
40
|
+
*/
|
|
41
|
+
path: () => any;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the search part of the current url as an object
|
|
44
|
+
*
|
|
45
|
+
* If the current URL is `/some/path?query=value#anchor`, this returns `{ query: 'value' }`
|
|
46
|
+
*
|
|
47
|
+
* @return the search (query) portion of the url, as an object
|
|
48
|
+
*/
|
|
49
|
+
search: () => any;
|
|
50
|
+
/**
|
|
51
|
+
* Gets the hash part of the current url
|
|
52
|
+
*
|
|
53
|
+
* If the current URL is `/some/path?query=value#anchor`, this returns `anchor`
|
|
54
|
+
*
|
|
55
|
+
* @return the hash (anchor) portion of the url
|
|
56
|
+
*/
|
|
57
|
+
hash: () => any;
|
|
58
|
+
_urlListeners: any[];
|
|
59
|
+
$get: (string | (($location: any, $browser: any, $rootScope: any) => this))[];
|
|
60
|
+
html5Mode(): boolean;
|
|
61
|
+
baseHref(): any;
|
|
62
|
+
_baseHref: any;
|
|
63
|
+
/**
|
|
64
|
+
* Gets the current url, or updates the url
|
|
65
|
+
*
|
|
66
|
+
* ### Getting the current URL
|
|
67
|
+
*
|
|
68
|
+
* When no arguments are passed, returns the current URL.
|
|
69
|
+
* The URL is normalized using the internal [[path]]/[[search]]/[[hash]] values.
|
|
70
|
+
*
|
|
71
|
+
* For example, the URL may be stored in the hash ([[HashLocationServices]]) or
|
|
72
|
+
* have a base HREF prepended ([[PushStateLocationServices]]).
|
|
73
|
+
*
|
|
74
|
+
* The raw URL in the browser might be:
|
|
75
|
+
*
|
|
76
|
+
* ```
|
|
77
|
+
* http://mysite.com/somepath/index.html#/internal/path/123?param1=foo#anchor
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* or
|
|
81
|
+
*
|
|
82
|
+
* ```
|
|
83
|
+
* http://mysite.com/basepath/internal/path/123?param1=foo#anchor
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* then this method returns:
|
|
87
|
+
*
|
|
88
|
+
* ```
|
|
89
|
+
* /internal/path/123?param1=foo#anchor
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
*
|
|
93
|
+
* #### Example:
|
|
94
|
+
* ```js
|
|
95
|
+
* locationServices.url(); // "/some/path?query=value#anchor"
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* ### Updating the URL
|
|
99
|
+
*
|
|
100
|
+
* When `newurl` arguments is provided, changes the URL to reflect `newurl`
|
|
101
|
+
*
|
|
102
|
+
* #### Example:
|
|
103
|
+
* ```js
|
|
104
|
+
* locationServices.url("/some/path?query=value#anchor", true);
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @param {string} newUrl The new value for the URL.
|
|
108
|
+
* This url should reflect only the new internal [[path]], [[search]], and [[hash]] values.
|
|
109
|
+
* It should not include the protocol, site, port, or base path of an absolute HREF.
|
|
110
|
+
* @param {boolean} replace When true, replaces the current history entry (instead of appending it) with this new url
|
|
111
|
+
* @param {any} state The history's state object, i.e., pushState (if the LocationServices implementation supports it)
|
|
112
|
+
*
|
|
113
|
+
* @return the url (after potentially being processed)
|
|
114
|
+
*/
|
|
115
|
+
url(newUrl: string, replace: boolean, state: any): any;
|
|
116
|
+
/**
|
|
117
|
+
* @internal
|
|
118
|
+
*
|
|
119
|
+
* Registers a low level url change handler
|
|
120
|
+
*
|
|
121
|
+
* Note: Because this is a low level handler, it's not recommended for general use.
|
|
122
|
+
*
|
|
123
|
+
* #### Example:
|
|
124
|
+
* ```js
|
|
125
|
+
* let deregisterFn = locationServices.onChange((evt) => console.log("url change", evt));
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @param callback a function that will be called when the url is changing
|
|
129
|
+
* @return a function that de-registers the callback
|
|
130
|
+
*/
|
|
131
|
+
onChange(callback: any): () => any;
|
|
132
|
+
/**
|
|
133
|
+
* Gets the current URL parts
|
|
134
|
+
*
|
|
135
|
+
* This method returns the different parts of the current URL (the [[path]], [[search]], and [[hash]]) as a [[UrlParts]] object.
|
|
136
|
+
*/
|
|
137
|
+
parts(): {
|
|
138
|
+
path: any;
|
|
139
|
+
search: any;
|
|
140
|
+
hash: any;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Activates the best rule for the current URL
|
|
144
|
+
*
|
|
145
|
+
* Checks the current URL for a matching [[UrlRule]], then invokes that rule's handler.
|
|
146
|
+
* This method is called internally any time the URL has changed.
|
|
147
|
+
*
|
|
148
|
+
* This effectively activates the state (or redirect, etc) which matches the current URL.
|
|
149
|
+
*
|
|
150
|
+
* #### Example:
|
|
151
|
+
* ```js
|
|
152
|
+
* urlService.deferIntercept();
|
|
153
|
+
*
|
|
154
|
+
* fetch('/states.json').then(resp => resp.json()).then(data => {
|
|
155
|
+
* data.forEach(state => $stateRegistry.register(state));
|
|
156
|
+
* urlService.listen();
|
|
157
|
+
* // Find the matching URL and invoke the handler.
|
|
158
|
+
* urlService.sync();
|
|
159
|
+
* });
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
sync(evt: any): void;
|
|
163
|
+
/**
|
|
164
|
+
* Starts or stops listening for URL changes
|
|
165
|
+
*
|
|
166
|
+
* Call this sometime after calling [[deferIntercept]] to start monitoring the url.
|
|
167
|
+
* This causes ng-router to start listening for changes to the URL, if it wasn't already listening.
|
|
168
|
+
*
|
|
169
|
+
* If called with `false`, ng-router will stop listening (call listen(true) to start listening again).
|
|
170
|
+
*
|
|
171
|
+
* #### Example:
|
|
172
|
+
* ```js
|
|
173
|
+
* urlService.deferIntercept();
|
|
174
|
+
*
|
|
175
|
+
* fetch('/states.json').then(resp => resp.json()).then(data => {
|
|
176
|
+
* data.forEach(state => $stateRegistry.register(state));
|
|
177
|
+
* // Start responding to URL changes
|
|
178
|
+
* urlService.listen();
|
|
179
|
+
* urlService.sync();
|
|
180
|
+
* });
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* @param enabled `true` or `false` to start or stop listening to URL changes
|
|
184
|
+
*/
|
|
185
|
+
listen(enabled: any): any;
|
|
186
|
+
_stopListeningFn: any;
|
|
187
|
+
/**
|
|
188
|
+
* Disables monitoring of the URL.
|
|
189
|
+
*
|
|
190
|
+
* Call this method before ng-router has bootstrapped.
|
|
191
|
+
* It will stop ng-router from performing the initial url sync.
|
|
192
|
+
*
|
|
193
|
+
* This can be useful to perform some asynchronous initialization before the router starts.
|
|
194
|
+
* Once the initialization is complete, call [[listen]] to tell ng-router to start watching and synchronizing the URL.
|
|
195
|
+
*
|
|
196
|
+
* #### Example:
|
|
197
|
+
* ```js
|
|
198
|
+
* // Prevent ng-router from automatically intercepting URL changes when it starts;
|
|
199
|
+
* urlService.deferIntercept();
|
|
200
|
+
*
|
|
201
|
+
* fetch('/states.json').then(resp => resp.json()).then(data => {
|
|
202
|
+
* data.forEach(state => $stateRegistry.register(state));
|
|
203
|
+
* urlService.listen();
|
|
204
|
+
* urlService.sync();
|
|
205
|
+
* });
|
|
206
|
+
* ```
|
|
207
|
+
*
|
|
208
|
+
* @param defer Indicates whether to defer location change interception.
|
|
209
|
+
* Passing no parameter is equivalent to `true`.
|
|
210
|
+
*/
|
|
211
|
+
deferIntercept(defer: any): void;
|
|
212
|
+
/**
|
|
213
|
+
* Matches a URL
|
|
214
|
+
*
|
|
215
|
+
* Given a URL (as a [[UrlParts]] object), check all rules and determine the best matching rule.
|
|
216
|
+
* Return the result as a [[MatchResult]].
|
|
217
|
+
* @returns {angular.MatchResult}
|
|
218
|
+
*/
|
|
219
|
+
match(url: any): angular.MatchResult;
|
|
220
|
+
update(read: any): void;
|
|
221
|
+
location: any;
|
|
222
|
+
/**
|
|
223
|
+
* Internal API.
|
|
224
|
+
*
|
|
225
|
+
* Pushes a new location to the browser history.
|
|
226
|
+
*
|
|
227
|
+
* @internal
|
|
228
|
+
* @param urlMatcher
|
|
229
|
+
* @param params
|
|
230
|
+
* @param options
|
|
231
|
+
*/
|
|
232
|
+
push(urlMatcher: any, params: any, options: any): void;
|
|
233
|
+
/**
|
|
234
|
+
* Builds and returns a URL with interpolated parameters
|
|
235
|
+
*
|
|
236
|
+
* #### Example:
|
|
237
|
+
* ```js
|
|
238
|
+
* matcher = $umf.compile("/about/:person");
|
|
239
|
+
* params = { person: "bob" };
|
|
240
|
+
* $bob = $urlService.href(matcher, params);
|
|
241
|
+
* // $bob == "/about/bob";
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.
|
|
245
|
+
* @param params An object of parameter values to fill the matcher's required parameters.
|
|
246
|
+
* @param options Options object. The options are:
|
|
247
|
+
*
|
|
248
|
+
* - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
|
|
249
|
+
*
|
|
250
|
+
* @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
|
|
251
|
+
*/
|
|
252
|
+
href(urlMatcher: any, params: any, options: any): any;
|
|
253
|
+
/**
|
|
254
|
+
* Creates a [[UrlMatcher]] for the specified pattern.
|
|
255
|
+
*
|
|
256
|
+
* @param pattern The URL pattern.
|
|
257
|
+
* @param config The config object hash.
|
|
258
|
+
* @returns The UrlMatcher.
|
|
259
|
+
*/
|
|
260
|
+
compile(pattern: any, config: any): UrlMatcher;
|
|
261
|
+
/**
|
|
262
|
+
* Returns true if the specified object is a [[UrlMatcher]], or false otherwise.
|
|
263
|
+
*
|
|
264
|
+
* @param object The object to perform the type check against.
|
|
265
|
+
* @returns `true` if the object matches the `UrlMatcher` interface, by
|
|
266
|
+
* implementing all the same methods.
|
|
267
|
+
*/
|
|
268
|
+
isMatcher(object: any): boolean;
|
|
274
269
|
}
|
|
275
270
|
import { UrlRuleFactory } from "./url-rule";
|
|
276
271
|
import { UrlRules } from "./url-rules";
|