@angular-wave/angular.ts 0.7.7 → 0.8.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.
- package/@types/animations/raf-scheduler.d.ts +2 -2
- package/@types/animations/shared.d.ts +0 -1
- package/@types/core/compile/attributes.d.ts +3 -3
- package/@types/core/compile/compile.d.ts +1 -1
- package/@types/core/di/injector.d.ts +0 -1
- package/@types/core/di/internal-injector.d.ts +1 -0
- package/@types/core/di/ng-module.d.ts +5 -0
- package/@types/core/filter/filter.d.ts +11 -13
- package/@types/core/parse/parse.d.ts +6 -7
- package/@types/core/sanitize/sanitize-uri.d.ts +3 -6
- package/@types/core/scope/scope.d.ts +1 -1
- package/@types/directive/attrs/attrs.d.ts +7 -1
- package/@types/directive/bind/bind.d.ts +2 -1
- package/@types/directive/events/events.d.ts +9 -3
- package/@types/directive/http/http.d.ts +6 -2
- package/@types/directive/include/include.d.ts +2 -2
- package/@types/directive/input/input.d.ts +2 -12
- package/@types/directive/messages/messages.d.ts +9 -48
- package/@types/directive/model/model.d.ts +3 -3
- package/@types/directive/options/options.d.ts +13 -20
- package/@types/directive/switch/switch.d.ts +1 -0
- package/@types/directive/transclude/transclude.d.ts +10 -6
- package/@types/index.d.ts +1 -1
- package/@types/interface.d.ts +56 -18
- package/@types/{public.d.ts → ng.d.ts} +2 -2
- package/@types/router/directives/view-directive.d.ts +2 -19
- package/@types/router/{common → glob}/glob.d.ts +5 -1
- package/@types/router/globals.d.ts +2 -3
- package/@types/router/path/path-utils.d.ts +8 -11
- package/@types/router/state/interface.d.ts +1 -1
- package/@types/router/state/state-object.d.ts +1 -1
- package/@types/router/state/state-registry.d.ts +1 -2
- package/@types/router/state/state-service.d.ts +8 -7
- package/@types/router/state-filters.d.ts +24 -2
- package/@types/router/transition/transition.d.ts +12 -15
- package/@types/router/url/url-matcher.d.ts +3 -3
- package/@types/router/url/url-rule.d.ts +1 -0
- package/@types/router/url/url-rules.d.ts +26 -6
- package/@types/router/url/url-service.d.ts +30 -42
- package/@types/services/anchor-scroll.d.ts +1 -1
- package/@types/{core → services/exception}/exception-handler.d.ts +4 -4
- package/@types/{core/error-handler.d.ts → services/exception/interface.d.ts} +1 -1
- package/@types/services/http/http.d.ts +48 -3
- package/@types/services/http/interface.d.ts +2 -2
- package/@types/services/http-backend/http-backend.d.ts +49 -44
- package/@types/services/location/interface.d.ts +63 -0
- package/@types/services/location/location.d.ts +330 -0
- package/@types/{core → services}/sce/sce.d.ts +1 -1
- package/@types/services/template-cache/interface.d.ts +8 -2
- package/@types/services/template-cache/template-cache.d.ts +1 -1
- package/@types/services/template-request.d.ts +1 -1
- package/@types/shared/cache.d.ts +0 -2
- package/@types/shared/common.d.ts +0 -2
- package/@types/shared/dom.d.ts +6 -0
- package/@types/shared/interface.d.ts +0 -4
- package/@types/{router/common → shared}/queue.d.ts +2 -2
- package/@types/shared/test-utils.d.ts +1 -0
- package/@types/shared/url-utils/interface.d.ts +46 -0
- package/@types/shared/url-utils/url-utils.d.ts +64 -0
- package/@types/shared/utils.d.ts +44 -6
- package/Makefile +8 -4
- package/dist/angular-ts.esm.js +1889 -2199
- package/dist/angular-ts.umd.js +1889 -2199
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/assets/scss/index.scss +23 -0
- package/docs/content/_index.md +9 -8
- package/docs/content/docs/_index.md +1 -1
- package/docs/content/docs/directive/app.md +1 -1
- package/docs/content/docs/directive/bind.md +10 -8
- package/docs/content/docs/directive/blur.md +1 -1
- package/docs/content/docs/directive/channel.md +2 -2
- package/docs/content/docs/directive/class-even.md +1 -1
- package/docs/content/docs/directive/class-odd.md +1 -1
- package/docs/content/docs/directive/class.md +1 -1
- package/docs/content/docs/directive/click.md +1 -1
- package/docs/content/docs/directive/copy.md +1 -1
- package/docs/content/docs/directive/cut.md +1 -1
- package/docs/content/docs/directive/dblclick.md +1 -1
- package/docs/content/docs/directive/focus.md +1 -1
- package/docs/content/docs/directive/get.md +203 -0
- package/docs/content/docs/directive/keydown.md +1 -1
- package/docs/content/docs/directive/keyup.md +1 -1
- package/docs/content/docs/directive/load.md +1 -1
- package/docs/content/docs/directive/mousedown.md +1 -1
- package/docs/content/docs/directive/mouseenter.md +1 -1
- package/docs/content/docs/directive/mouseleave.md +1 -1
- package/docs/content/docs/directive/mousemove.md +1 -1
- package/docs/content/docs/directive/mouseout.md +1 -1
- package/docs/content/docs/directive/mouseover.md +1 -1
- package/docs/content/docs/directive/mouseup.md +1 -1
- package/docs/content/docs/directive/non-bindable.md +28 -0
- package/docs/content/docs/provider/locationProvider.md +26 -0
- package/docs/content/docs/provider/templateCacheProvider.md +66 -1
- package/docs/content/docs/service/location.md +57 -0
- package/docs/content/docs/service/templateCache.md +2 -2
- package/docs/content/docs/service/url.md +5 -0
- package/docs/layouts/partials/hooks/head-end.html +1 -1
- package/docs/layouts/shortcodes/showcss.html +2 -0
- package/docs/layouts/shortcodes/version.html +1 -0
- package/docs/static/examples/counter/counter-test.html +0 -4
- package/docs/static/examples/eventbus/eventbus-test.html +0 -4
- package/docs/static/examples/ng-bind/ng-bind.html +2 -2
- package/docs/static/examples/ng-non-bindable/ng-non-bindable-test.html +13 -0
- package/docs/static/examples/ng-non-bindable/ng-non-bindable.html +3 -0
- package/docs/static/examples/ng-non-bindable/ng-non-bindable.test.js +11 -0
- package/docs/static/typedoc/assets/hierarchy.js +1 -1
- package/docs/static/typedoc/assets/highlight.css +6 -6
- package/docs/static/typedoc/assets/navigation.js +1 -1
- package/docs/static/typedoc/assets/search.js +1 -1
- package/docs/static/typedoc/classes/Location.html +55 -0
- package/docs/static/typedoc/classes/LocationProvider.html +20 -0
- package/docs/static/typedoc/classes/NgModule.html +32 -0
- package/docs/static/typedoc/classes/TemplateCacheProvider.html +1 -1
- package/docs/static/typedoc/hierarchy.html +1 -1
- package/docs/static/typedoc/index.html +1 -1
- package/docs/static/typedoc/interfaces/DefaultPorts.html +5 -0
- package/docs/static/typedoc/interfaces/Directive.html +5 -4
- package/docs/static/typedoc/interfaces/Html5Mode.html +23 -0
- package/docs/static/typedoc/interfaces/HttpProviderDefaults.html +1 -1
- package/docs/static/typedoc/interfaces/HttpResponse.html +2 -3
- package/docs/static/typedoc/interfaces/Provider.html +16 -10
- package/docs/static/typedoc/interfaces/RequestConfig.html +1 -1
- package/docs/static/typedoc/interfaces/RequestShortcutConfig.html +1 -1
- package/docs/static/typedoc/interfaces/TemplateCache.html +7 -0
- package/docs/static/typedoc/interfaces/UrlParts.html +9 -0
- package/docs/static/typedoc/types/AnnotatedDirectiveFactory.html +1 -0
- package/docs/static/typedoc/types/AnnotatedFactory.html +1 -1
- package/docs/static/typedoc/types/DirectiveFactory.html +1 -2
- package/docs/static/typedoc/types/DirectiveFactoryFn.html +1 -0
- package/docs/static/typedoc/types/Expression.html +1 -1
- package/docs/static/typedoc/types/HttpResponseStatus.html +1 -0
- package/docs/static/typedoc/types/{TemplateCache.html → SwapModeType.html} +1 -1
- package/docs/static/typedoc/types/UrlChangeListener.html +5 -0
- package/docs/static/typedoc/variables/SwapMode.html +11 -0
- package/docs/static/version.js +13 -0
- package/docs/test-results/.last-run.json +4 -0
- package/docs/test-results/static-examples-counter-counter-counter-example/error-context.md +50 -0
- package/legacy.d.ts +0 -10
- package/package.json +1 -3
- package/src/{loader.js → angular.js} +5 -10
- package/src/angular.spec.js +189 -21
- package/src/animations/animate-children-directive.js +2 -2
- package/src/animations/animate-css.js +17 -18
- package/src/animations/animate.spec.js +1 -1
- package/src/animations/raf-scheduler.js +1 -1
- package/src/animations/shared.js +2 -12
- package/src/binding.spec.js +1 -1
- package/src/core/compile/attributes.js +1 -1
- package/src/core/compile/compile.js +7 -10
- package/src/core/compile/compile.spec.js +1 -1
- package/src/core/controller/controller.spec.js +1 -1
- package/src/core/controller/controller.test.js +1 -0
- package/src/core/di/injector.js +11 -25
- package/src/core/di/injector.spec.js +2 -2
- package/src/core/di/injector.test.js +2 -2
- package/src/core/di/internal-injector.js +7 -7
- package/src/core/di/ng-module.js +12 -27
- package/src/core/filter/filter.js +28 -28
- package/src/core/filter/filter.spec.js +1 -1
- package/src/core/filter/filter.test.js +1 -0
- package/src/core/interpolate/interpolate.js +4 -6
- package/src/core/interpolate/interpolate.spec.js +1 -1
- package/src/core/interpolate/interpolate.test.js +1 -0
- package/src/core/parse/ast/ast.spec.js +1 -1
- package/src/core/parse/ast/ast.test.js +1 -1
- package/src/core/parse/interpreter.js +32 -38
- package/src/core/parse/lexer/lexer.spec.js +1 -1
- package/src/core/parse/parse.js +150 -146
- package/src/core/parse/parse.spec.js +17 -16
- package/src/core/prop.spec.js +1 -1
- package/src/core/root-element.spec.js +1 -1
- package/src/core/sanitize/sanitize-uri.js +3 -3
- package/src/core/scope/scope.js +12 -13
- package/src/core/scope/scope.spec.js +3 -4
- package/src/directive/aria/aria.spec.js +1 -1
- package/src/directive/aria/aria.test.js +1 -0
- package/src/directive/attrs/attrs.js +7 -4
- package/src/directive/attrs/attrs.spec.js +1 -1
- package/src/directive/attrs/attrs.test.js +1 -0
- package/src/directive/attrs/boolean.spec.js +1 -1
- package/src/directive/attrs/boolean.test.js +1 -0
- package/src/directive/attrs/element-style.spec.js +1 -1
- package/src/directive/attrs/element-style.test.js +1 -0
- package/src/directive/attrs/src.spec.js +1 -1
- package/src/directive/attrs/src.test.js +1 -0
- package/src/directive/bind/bind-html.spec.js +1 -1
- package/src/directive/bind/bind.js +1 -0
- package/src/directive/bind/bind.spec.js +1 -1
- package/src/directive/bind/bind.test.js +1 -0
- package/src/directive/channel/channel.spec.js +1 -1
- package/src/directive/channel/channel.test.js +1 -0
- package/src/directive/class/class.spec.js +1 -1
- package/src/directive/class/class.test.js +1 -0
- package/src/directive/cloak/cloak.spec.js +1 -1
- package/src/directive/cloak/cloak.test.js +1 -0
- package/src/directive/controller/controller.spec.js +1 -1
- package/src/directive/controller/controller.test.js +1 -0
- package/src/directive/events/click.spec.js +1 -1
- package/src/directive/events/event.spec.js +1 -1
- package/src/directive/events/events.js +6 -2
- package/src/directive/events/events.test.js +1 -0
- package/src/directive/form/form.js +8 -5
- package/src/directive/form/form.spec.js +1 -1
- package/src/directive/form/form.test.js +1 -0
- package/src/directive/http/delete.spec.js +3 -1
- package/src/directive/http/form-test.html +18 -0
- package/src/directive/http/get.spec.js +281 -4
- package/src/directive/http/http.js +112 -15
- package/src/directive/http/http.test.js +2 -2
- package/src/directive/http/post.spec.js +506 -9
- package/src/directive/http/put.spec.js +3 -1
- package/src/directive/if/if.spec.js +1 -1
- package/src/directive/include/include.js +7 -7
- package/src/directive/include/include.spec.js +1 -1
- package/src/directive/init/init.spec.js +1 -1
- package/src/directive/init/init.test.js +1 -0
- package/src/directive/input/input.js +19 -43
- package/src/directive/input/input.spec.js +1 -2
- package/src/directive/input/input.test.js +1 -0
- package/src/directive/messages/messages.js +4 -0
- package/src/directive/messages/messages.spec.js +1 -1
- package/src/directive/messages/messages.test.js +1 -0
- package/src/directive/model/model.js +14 -14
- package/src/directive/model/model.spec.js +1 -1
- package/src/directive/model/model.test.js +1 -0
- package/src/directive/model-options/model-option.test.js +1 -0
- package/src/directive/model-options/model-options.js +1 -1
- package/src/directive/model-options/model-options.spec.js +1 -1
- package/src/directive/non-bindable/non-bindable.spec.js +1 -1
- package/src/directive/non-bindable/non-bindable.test.js +1 -0
- package/src/directive/observe/observe.spec.js +1 -1
- package/src/directive/observe/observe.test.js +1 -0
- package/src/directive/on/on.spec.js +1 -1
- package/src/directive/on/on.test.js +1 -0
- package/src/directive/options/options.js +454 -464
- package/src/directive/options/options.spec.js +1 -1
- package/src/directive/options/options.test.js +1 -0
- package/src/directive/ref/href.spec.js +1 -1
- package/src/directive/ref/href.test.js +2 -0
- package/src/directive/ref/ref.spec.js +1 -1
- package/src/directive/repeat/repeat.spec.js +2 -3
- package/src/directive/repeat/repeat.test.js +1 -0
- package/src/directive/script/script.spec.js +1 -1
- package/src/directive/script/script.test.js +1 -0
- package/src/directive/select/select.js +1 -1
- package/src/directive/select/select.spec.js +1 -1
- package/src/directive/select/select.test.js +1 -0
- package/src/directive/setter/setter.js +12 -14
- package/src/directive/setter/setter.spec.js +40 -17
- package/src/directive/setter/setter.test.js +1 -0
- package/src/directive/show-hide/show-hide.spec.js +1 -1
- package/src/directive/show-hide/show-hide.test.js +1 -0
- package/src/directive/style/style.spec.js +1 -1
- package/src/directive/style/style.test.js +1 -0
- package/src/directive/switch/switch.js +1 -0
- package/src/directive/switch/switch.spec.js +1 -1
- package/src/directive/switch/switch.test.js +1 -0
- package/src/directive/transclude/transclude.js +87 -89
- package/src/directive/validators/validators.js +82 -84
- package/src/directive/validators/validators.spec.js +5 -4
- package/src/directive/validators/validators.test.js +1 -0
- package/src/filters/filter.spec.js +1 -1
- package/src/filters/filters.spec.js +1 -1
- package/src/filters/limit-to.js +2 -3
- package/src/filters/limit-to.spec.js +1 -1
- package/src/filters/order-by.spec.js +1 -1
- package/src/index.js +1 -1
- package/src/injection-tokens.js +6 -2
- package/src/interface.ts +70 -19
- package/src/loader.md +0 -155
- package/src/{public.js → ng.js} +16 -23
- package/src/{public.spec.js → ng.spec.js} +1 -1
- package/src/router/directives/state-directives.spec.js +9 -8
- package/src/router/directives/view-directive.js +11 -9
- package/src/router/directives/view-directive.spec.js +8 -9
- package/src/router/{common/common.html → glob/glob.html} +2 -3
- package/src/router/{common → glob}/glob.js +5 -0
- package/src/router/{common/common.test.js → glob/glob.test.js} +2 -1
- package/src/router/globals.js +1 -2
- package/src/router/path/path-utils.js +5 -0
- package/src/router/router-test-hashbang.html +45 -0
- package/src/router/services.spec.js +5 -6
- package/src/router/state/interface.ts +1 -1
- package/src/router/state/state-builder.js +3 -3
- package/src/router/state/state-builder.spec.js +1 -1
- package/src/router/state/state-object.js +1 -1
- package/src/router/state/state-registry.js +2 -3
- package/src/router/state/state-service.js +13 -10
- package/src/router/state/state.spec.js +23 -22
- package/src/router/state/state.test.js +1 -0
- package/src/router/state/views.js +1 -1
- package/src/router/state-filter.spec.js +1 -1
- package/src/router/state-filters.js +15 -11
- package/src/router/template-factory.js +5 -4
- package/src/router/template-factory.spec.js +1 -1
- package/src/router/transition/hook-registry.js +1 -1
- package/src/router/transition/transition-service.js +6 -5
- package/src/router/transition/transition.js +4 -4
- package/src/router/url/url-matcher.js +3 -3
- package/src/router/url/url-rule.js +1 -0
- package/src/router/url/url-rules.js +8 -5
- package/src/router/url/url-service.js +82 -85
- package/src/router/url/url-service.spec.js +55 -39
- package/src/router/url/url.test.js +1 -0
- package/src/router/view/view.js +4 -5
- package/src/router/view/view.spec.js +10 -12
- package/src/router/view/view.test.js +1 -0
- package/src/router/view-hook.spec.js +1 -1
- package/src/router/view-scroll.spec.js +1 -1
- package/src/services/anchor-scroll.html +2 -9
- package/src/services/anchor-scroll.js +6 -5
- package/src/{core → services/exception}/exception-handler.js +2 -2
- package/src/{core/error-handler.ts → services/exception/interface.ts} +1 -1
- package/src/services/http/http.js +11 -17
- package/src/services/http/http.spec.js +2 -7
- package/src/services/http/interface.ts +2 -2
- package/src/services/http/template-request.spec.js +1 -1
- package/src/services/http-backend/http-backend.js +53 -89
- package/src/services/http-backend/http-backend.spec.js +2 -6
- package/src/services/http-backend/http-backend.test.js +1 -0
- package/src/services/location/interface.ts +70 -0
- package/src/{core → services}/location/location.html +4 -1
- package/src/services/location/location.js +999 -0
- package/src/{core → services}/location/location.spec.js +911 -532
- package/src/{core → services}/location/location.test.js +2 -2
- package/src/services/log/log.spec.js +1 -1
- package/src/services/log/log.test.js +1 -0
- package/src/services/pubsub/pubsub.spec.js +1 -1
- package/src/{core → services}/sce/sce.html +1 -1
- package/src/{core → services}/sce/sce.js +14 -10
- package/src/{core → services}/sce/sce.md +2 -2
- package/src/{core → services}/sce/sce.spec.js +3 -4
- package/src/{core → services}/sce/sce.test.js +1 -1
- package/src/services/template-cache/interface.ts +8 -2
- package/src/services/template-cache/template-cache.js +3 -1
- package/src/services/template-cache/template-cache.spec.js +73 -1
- package/src/services/template-cache/template-cache.test.js +1 -0
- package/src/services/template-request.js +2 -1
- package/src/shared/cache.js +0 -2
- package/src/shared/common.js +0 -5
- package/src/shared/common.spec.js +1 -1
- package/src/shared/dom.js +10 -0
- package/src/shared/interface.ts +0 -4
- package/src/{router/common → shared}/queue.js +7 -7
- package/src/shared/shared.html +1 -0
- package/src/shared/shared.test.js +1 -0
- package/src/shared/test-utils.js +1 -0
- package/src/shared/url-utils/interface.ts +54 -0
- package/src/{core → shared}/url-utils/url-utils.html +4 -1
- package/src/{core → shared}/url-utils/url-utils.js +26 -47
- package/src/{core → shared}/url-utils/url-utils.spec.js +10 -17
- package/src/{core → shared}/url-utils/url-utils.test.js +1 -1
- package/src/shared/utils.js +60 -9
- package/src/shared/utils.spec.js +35 -1
- package/src/src.html +1 -2
- package/typedoc.json +0 -1
- package/utils/express.js +36 -2
- package/utils/version.cjs +23 -0
- package/@types/core/location/location.d.ts +0 -317
- package/@types/core/task-tracker-factory.d.ts +0 -76
- package/@types/core/url-utils/url-utils.d.ts +0 -56
- package/@types/router/state-provider.d.ts +0 -123
- package/@types/services/browser.d.ts +0 -101
- package/docs/static/typedoc/types/SwapInsertPosition.html +0 -2
- package/jsdoc.json +0 -22
- package/src/core/location/location.js +0 -984
- package/src/core/location/location.md +0 -114
- package/src/core/task-tracker-factory.js +0 -145
- package/src/core/url-utils/url-utils.md +0 -46
- package/src/directive/non-bindable/non-bindable.md +0 -17
- package/src/loader.spec.js +0 -169
- package/src/router/state-provider.js +0 -146
- package/src/services/browser.js +0 -212
- /package/@types/{loader.d.ts → angular.d.ts} +0 -0
- /package/src/router/{common → glob}/glob.spec.js +0 -0
- /package/src/{router/common → shared}/queue.spec.js +0 -0
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This is where we hold the global mutable state such as current state, current
|
|
6
6
|
* params, current transition, etc.
|
|
7
|
-
* @implements {ServiceProvider}
|
|
8
7
|
*/
|
|
9
|
-
export class RouterGlobals
|
|
8
|
+
export class RouterGlobals {
|
|
10
9
|
/**
|
|
11
10
|
* Current parameter values
|
|
12
11
|
*
|
|
@@ -45,4 +44,4 @@ export class RouterGlobals implements ServiceProvider {
|
|
|
45
44
|
*/
|
|
46
45
|
export type ServiceProvider = import("../interface.ts").ServiceProvider;
|
|
47
46
|
import { StateParams } from "./params/state-params.js";
|
|
48
|
-
import { Queue } from "
|
|
47
|
+
import { Queue } from "../shared/queue.js";
|
|
@@ -34,19 +34,16 @@ export class PathUtils {
|
|
|
34
34
|
static inheritParams(fromPath: any, toPath: any, toKeys?: any[]): any;
|
|
35
35
|
/**
|
|
36
36
|
* Computes the tree changes (entering, exiting) between a fromPath and toPath.
|
|
37
|
+
* @param {PathNode[]} fromPath
|
|
38
|
+
* @param {PathNode[]} toPath
|
|
39
|
+
* @param {boolean} [reloadState]
|
|
40
|
+
* @returns {import("../transition/interface.js").TreeChanges}
|
|
37
41
|
*/
|
|
38
42
|
static treeChanges(
|
|
39
|
-
fromPath:
|
|
40
|
-
toPath:
|
|
41
|
-
reloadState
|
|
42
|
-
):
|
|
43
|
-
from: any;
|
|
44
|
-
to: any;
|
|
45
|
-
retained: any;
|
|
46
|
-
retainedWithToParams: any;
|
|
47
|
-
exiting: any;
|
|
48
|
-
entering: any;
|
|
49
|
-
};
|
|
43
|
+
fromPath: PathNode[],
|
|
44
|
+
toPath: PathNode[],
|
|
45
|
+
reloadState?: boolean,
|
|
46
|
+
): import("../transition/interface.js").TreeChanges;
|
|
50
47
|
/**
|
|
51
48
|
* Returns a new path which is: the subpath of the first path which matches the second path.
|
|
52
49
|
*
|
|
@@ -589,7 +589,7 @@ export interface StateDeclaration {
|
|
|
589
589
|
*
|
|
590
590
|
* An optional object which defines multiple views, or explicitly targets specific named ui-views.
|
|
591
591
|
*
|
|
592
|
-
* - What is a view
|
|
592
|
+
* - What is a view urlConfig
|
|
593
593
|
* - What is a ui-view
|
|
594
594
|
* - Shorthand controller/template
|
|
595
595
|
* - Incompatible with ^
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This API is found at `$stateRegistry` ([[UIRouter.stateRegistry]])
|
|
6
6
|
*
|
|
7
|
-
* @implements {ServiceProvider}
|
|
8
7
|
*/
|
|
9
|
-
export class StateRegistryProvider
|
|
8
|
+
export class StateRegistryProvider {
|
|
10
9
|
static $inject: string[];
|
|
11
10
|
/**
|
|
12
11
|
* @param urlService
|
|
@@ -76,9 +76,9 @@ export class StateProvider {
|
|
|
76
76
|
* - **params** `{object}` - returns an array of state params that are ensured to
|
|
77
77
|
* be a super-set of parent's params.
|
|
78
78
|
* - **views** `{object}` - returns a views object where each key is an absolute view
|
|
79
|
-
* name (i.e. "viewName@stateName") and each value is the
|
|
79
|
+
* name (i.e. "viewName@stateName") and each value is the urlConfig object
|
|
80
80
|
* (template, controller) for the view. Even when you don't use the views object
|
|
81
|
-
* explicitly on a state
|
|
81
|
+
* explicitly on a state urlConfig, one is still created for you internally.
|
|
82
82
|
* So by decorating this builder function you have access to decorating template
|
|
83
83
|
* and controller properties.
|
|
84
84
|
* - **ownParams** `{object}` - returns an array of params that belong to the state,
|
|
@@ -96,10 +96,10 @@ export class StateProvider {
|
|
|
96
96
|
* let result = {},
|
|
97
97
|
* views = parent(state);
|
|
98
98
|
*
|
|
99
|
-
* angular.forEach(views, function (
|
|
99
|
+
* angular.forEach(views, function (urlConfig, name) {
|
|
100
100
|
* let autoName = (state.name + '.' + name).replace('.', '/');
|
|
101
|
-
*
|
|
102
|
-
* result[name] =
|
|
101
|
+
* urlConfig.templateUrl = urlConfig.templateUrl || '/partials/' + autoName + '.html';
|
|
102
|
+
* result[name] = urlConfig;
|
|
103
103
|
* });
|
|
104
104
|
* return result;
|
|
105
105
|
* });
|
|
@@ -123,7 +123,7 @@ export class StateProvider {
|
|
|
123
123
|
* @param {object} func A function that is responsible for decorating the original
|
|
124
124
|
* builder function. The function receives two parameters:
|
|
125
125
|
*
|
|
126
|
-
* - `{object}` - state - The state
|
|
126
|
+
* - `{object}` - state - The state urlConfig object.
|
|
127
127
|
* - `{object}` - super - The original builder function.
|
|
128
128
|
*
|
|
129
129
|
* @return {object} $stateProvider - $stateProvider instance
|
|
@@ -265,7 +265,7 @@ export class StateProvider {
|
|
|
265
265
|
* This may be returned from a Transition Hook to redirect a transition, for example.
|
|
266
266
|
*/
|
|
267
267
|
target(identifier: any, params: any, options?: {}): TargetState;
|
|
268
|
-
getCurrentPath():
|
|
268
|
+
getCurrentPath(): PathNode[];
|
|
269
269
|
/**
|
|
270
270
|
* Low-level method for transitioning to a new state.
|
|
271
271
|
*
|
|
@@ -419,3 +419,4 @@ export class StateProvider {
|
|
|
419
419
|
lazyLoad(stateOrName: any, transition: any): any;
|
|
420
420
|
}
|
|
421
421
|
import { TargetState } from "./target-state.js";
|
|
422
|
+
import { PathNode } from "../path/path-node.js";
|
|
@@ -1,15 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* `isState` Filter: truthy if the current state is the parameter
|
|
3
|
+
*
|
|
4
|
+
* Translates to [[StateService.is]] `$state.is("stateName")`.
|
|
5
|
+
*
|
|
6
|
+
* #### Example:
|
|
7
|
+
* ```html
|
|
8
|
+
* <div ng-if="'stateName' | isState">show if state is 'stateName'</div>
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @param {import('./state/state-service.js').StateProvider} $state
|
|
2
12
|
* @returns {import('../interface.ts').FilterFn}
|
|
3
13
|
*/
|
|
4
|
-
export function $IsStateFilter(
|
|
14
|
+
export function $IsStateFilter(
|
|
15
|
+
$state: import("./state/state-service.js").StateProvider,
|
|
16
|
+
): import("../interface.ts").FilterFn;
|
|
5
17
|
export namespace $IsStateFilter {
|
|
6
18
|
let $inject: string[];
|
|
7
19
|
}
|
|
8
20
|
/**
|
|
21
|
+
* `includedByState` Filter: truthy if the current state includes the parameter
|
|
22
|
+
*
|
|
23
|
+
* Translates to [[StateService.includes]]` $state.is("fullOrPartialStateName")`.
|
|
24
|
+
*
|
|
25
|
+
* #### Example:
|
|
26
|
+
* ```html
|
|
27
|
+
* <div ng-if="'fullOrPartialStateName' | includedByState">show if state includes 'fullOrPartialStateName'</div>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @param {import('./state/state-service.js').StateProvider} $state
|
|
9
31
|
* @returns {import('../interface.ts').FilterFn}
|
|
10
32
|
*/
|
|
11
33
|
export function $IncludedByStateFilter(
|
|
12
|
-
$state:
|
|
34
|
+
$state: import("./state/state-service.js").StateProvider,
|
|
13
35
|
): import("../interface.ts").FilterFn;
|
|
14
36
|
export namespace $IncludedByStateFilter {
|
|
15
37
|
let $inject_1: string[];
|
|
@@ -14,15 +14,15 @@ export class Transition implements IHookRegistry {
|
|
|
14
14
|
*
|
|
15
15
|
* If the target state is not valid, an error is thrown.
|
|
16
16
|
*
|
|
17
|
-
* @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`
|
|
17
|
+
* @param {Array<import('../path/path-node.js').PathNode>} fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`
|
|
18
18
|
* encapsulates the "from state".
|
|
19
|
-
* @param targetState The target state and parameters being transitioned to (also, the transition options)
|
|
19
|
+
* @param {import('../state/target-state.js').TargetState} targetState The target state and parameters being transitioned to (also, the transition options)
|
|
20
20
|
* @param {import('../transition/transition-service.js').TransitionProvider} transitionService The [[TransitionService]] instance
|
|
21
21
|
* @param {import('../globals.js').RouterGlobals} globals
|
|
22
22
|
*/
|
|
23
23
|
constructor(
|
|
24
|
-
fromPath:
|
|
25
|
-
targetState:
|
|
24
|
+
fromPath: Array<import("../path/path-node.js").PathNode>,
|
|
25
|
+
targetState: import("../state/target-state.js").TargetState,
|
|
26
26
|
transitionService: import("../transition/transition-service.js").TransitionProvider,
|
|
27
27
|
globals: import("../globals.js").RouterGlobals,
|
|
28
28
|
);
|
|
@@ -44,17 +44,10 @@ export class Transition implements IHookRegistry {
|
|
|
44
44
|
_hookBuilder: HookBuilder;
|
|
45
45
|
/** Checks if this transition is currently active/running. */
|
|
46
46
|
isActive: () => boolean;
|
|
47
|
-
_targetState:
|
|
47
|
+
_targetState: import("../state/target-state.js").TargetState;
|
|
48
48
|
_options: any;
|
|
49
49
|
$id: number;
|
|
50
|
-
_treeChanges:
|
|
51
|
-
from: any;
|
|
52
|
-
to: any;
|
|
53
|
-
retained: any;
|
|
54
|
-
retainedWithToParams: any;
|
|
55
|
-
exiting: any;
|
|
56
|
-
entering: any;
|
|
57
|
-
};
|
|
50
|
+
_treeChanges: import("./interface.js").TreeChanges;
|
|
58
51
|
onStart: any;
|
|
59
52
|
onBefore: any;
|
|
60
53
|
onSuccess: any;
|
|
@@ -101,7 +94,7 @@ export class Transition implements IHookRegistry {
|
|
|
101
94
|
*
|
|
102
95
|
* @returns the [[TargetState]] of this Transition
|
|
103
96
|
*/
|
|
104
|
-
targetState():
|
|
97
|
+
targetState(): import("../state/target-state.js").TargetState;
|
|
105
98
|
/**
|
|
106
99
|
* Determines whether two transitions are equivalent.
|
|
107
100
|
* @deprecated
|
|
@@ -319,7 +312,11 @@ export class Transition implements IHookRegistry {
|
|
|
319
312
|
* @returns a list of ViewConfig objects for the given path.
|
|
320
313
|
*/
|
|
321
314
|
views(pathname: string, state: any): any;
|
|
322
|
-
treeChanges(
|
|
315
|
+
treeChanges(
|
|
316
|
+
pathname: any,
|
|
317
|
+
):
|
|
318
|
+
| import("../path/path-node.js").PathNode[]
|
|
319
|
+
| import("./interface.js").TreeChanges;
|
|
323
320
|
/**
|
|
324
321
|
* Creates a new transition that is a redirection of the current one.
|
|
325
322
|
*
|
|
@@ -112,9 +112,9 @@ export class UrlMatcher {
|
|
|
112
112
|
* // returns { id: 'bob', q: 'hello', r: null }
|
|
113
113
|
* ```
|
|
114
114
|
*
|
|
115
|
-
* @param path The URL path to match, e.g. `$location.
|
|
116
|
-
* @param search URL search parameters, e.g. `$location.
|
|
117
|
-
* @param hash URL hash e.g. `$location.
|
|
115
|
+
* @param path The URL path to match, e.g. `$location.getPath()`.
|
|
116
|
+
* @param search URL search parameters, e.g. `$location.getSearch()`.
|
|
117
|
+
* @param hash URL hash e.g. `$location.getHash()`.
|
|
118
118
|
*
|
|
119
119
|
* @returns The captured parameter values.
|
|
120
120
|
*/
|
|
@@ -6,14 +6,15 @@
|
|
|
6
6
|
*
|
|
7
7
|
* The most commonly used methods are [[otherwise]] and [[when]].
|
|
8
8
|
*
|
|
9
|
-
* This API is found at `$
|
|
9
|
+
* This API is found at `$url.rules` (see: [[UIRouter.urlService]], [[URLService.rules]])
|
|
10
10
|
*/
|
|
11
11
|
export class UrlRules {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/** @param {UrlRuleFactory} urlRuleFactory */
|
|
13
|
+
constructor(urlRuleFactory: UrlRuleFactory);
|
|
14
|
+
_sortFn: typeof defaultRuleSortFn;
|
|
14
15
|
_rules: any[];
|
|
15
16
|
_id: number;
|
|
16
|
-
urlRuleFactory:
|
|
17
|
+
urlRuleFactory: UrlRuleFactory;
|
|
17
18
|
/**
|
|
18
19
|
* Defines the initial state, path, or behavior to use when the app starts.
|
|
19
20
|
*
|
|
@@ -94,7 +95,7 @@ export class UrlRules {
|
|
|
94
95
|
* @param handler The url path to redirect to, or a function which returns the url path (or performs custom logic).
|
|
95
96
|
*/
|
|
96
97
|
otherwise(handler: any): void;
|
|
97
|
-
_otherwiseFn:
|
|
98
|
+
_otherwiseFn: import("./url-rule.js").BaseUrlRule;
|
|
98
99
|
_sorted: boolean;
|
|
99
100
|
/**
|
|
100
101
|
* Remove a rule previously registered
|
|
@@ -225,5 +226,24 @@ export class UrlRules {
|
|
|
225
226
|
*
|
|
226
227
|
* @return the registered [[UrlRule]]
|
|
227
228
|
*/
|
|
228
|
-
when(
|
|
229
|
+
when(
|
|
230
|
+
matcher: any,
|
|
231
|
+
handler: any,
|
|
232
|
+
options: any,
|
|
233
|
+
): import("./url-rule.js").BaseUrlRule;
|
|
229
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Default rule priority sorting function.
|
|
237
|
+
*
|
|
238
|
+
* Sorts rules by:
|
|
239
|
+
*
|
|
240
|
+
* - Explicit priority (set rule priority using [[UrlRules.when]])
|
|
241
|
+
* - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1)
|
|
242
|
+
* - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule.
|
|
243
|
+
* - Rule registration order (for rule types other than STATE and URLMATCHER)
|
|
244
|
+
* - Equally sorted State and UrlMatcher rules will each match the URL.
|
|
245
|
+
* Then, the *best* match is chosen based on how many parameter values were matched.
|
|
246
|
+
*/
|
|
247
|
+
declare function defaultRuleSortFn(a: any, b: any): number;
|
|
248
|
+
import { UrlRuleFactory } from "./url-rule.js";
|
|
249
|
+
export {};
|
|
@@ -4,76 +4,70 @@
|
|
|
4
4
|
export class UrlService {
|
|
5
5
|
static $inject: string[];
|
|
6
6
|
/**
|
|
7
|
-
* @param {import("../../
|
|
7
|
+
* @param {import("../../services/location/location").LocationProvider} $locationProvider
|
|
8
8
|
* @param {import("../../router/state/state-service.js").StateProvider} stateService
|
|
9
|
-
* @param globals
|
|
9
|
+
* @param {import("../../router/globals.js").RouterGlobals} globals
|
|
10
10
|
* @param {import("../../router/url/url-config.js").UrlConfigProvider} urlConfigProvider
|
|
11
11
|
*/
|
|
12
12
|
constructor(
|
|
13
13
|
$locationProvider: any,
|
|
14
14
|
stateService: import("../../router/state/state-service.js").StateProvider,
|
|
15
|
-
globals:
|
|
15
|
+
globals: import("../../router/globals.js").RouterGlobals,
|
|
16
16
|
urlConfigProvider: import("../../router/url/url-config.js").UrlConfigProvider,
|
|
17
17
|
);
|
|
18
|
-
|
|
18
|
+
/** @type {import("../../services/location/location").Location} */
|
|
19
|
+
$location: any;
|
|
19
20
|
$locationProvider: any;
|
|
20
|
-
|
|
21
|
-
$browser: import("../../services/browser.js").Browser;
|
|
21
|
+
stateService: import("../../router/state/state-service.js").StateProvider;
|
|
22
22
|
/** Provides services related to the URL */
|
|
23
23
|
urlRuleFactory: UrlRuleFactory;
|
|
24
24
|
/**
|
|
25
25
|
* The nested [[UrlRules]] API for managing URL rules and rewrites
|
|
26
|
-
*
|
|
27
|
-
* See: [[UrlRules]] for details
|
|
28
26
|
* @type {UrlRules}
|
|
29
27
|
*/
|
|
30
28
|
rules: UrlRules;
|
|
31
29
|
/**
|
|
32
30
|
* The nested [[UrlConfig]] API to configure the URL and retrieve URL information
|
|
33
|
-
*
|
|
34
|
-
* See: [[UrlConfig]] for details
|
|
35
31
|
* @type {import("./url-config.js").UrlConfigProvider}
|
|
36
32
|
*/
|
|
37
33
|
config: import("./url-config.js").UrlConfigProvider;
|
|
38
34
|
/** Creates a new [[Param]] for a given location (DefType) */
|
|
39
35
|
paramFactory: ParamFactory;
|
|
36
|
+
_urlListeners: any[];
|
|
40
37
|
/**
|
|
41
38
|
* Gets the path part of the current url
|
|
42
39
|
*
|
|
43
40
|
* If the current URL is `/some/path?query=value#anchor`, this returns `/some/path`
|
|
44
41
|
*
|
|
45
|
-
* @return the path portion of the url
|
|
42
|
+
* @return {string} the path portion of the url
|
|
46
43
|
*/
|
|
47
|
-
|
|
44
|
+
getPath(): string;
|
|
48
45
|
/**
|
|
49
46
|
* Gets the search part of the current url as an object
|
|
50
47
|
*
|
|
51
48
|
* If the current URL is `/some/path?query=value#anchor`, this returns `{ query: 'value' }`
|
|
52
49
|
*
|
|
53
|
-
* @return the search (query) portion of the url, as an object
|
|
50
|
+
* @return {Object} the search (query) portion of the url, as an object
|
|
54
51
|
*/
|
|
55
|
-
|
|
52
|
+
getSearch(): any;
|
|
56
53
|
/**
|
|
57
54
|
* Gets the hash part of the current url
|
|
58
55
|
*
|
|
59
56
|
* If the current URL is `/some/path?query=value#anchor`, this returns `anchor`
|
|
60
57
|
*
|
|
61
|
-
* @return the hash (anchor) portion of the url
|
|
58
|
+
* @return {string} the hash (anchor) portion of the url
|
|
62
59
|
*/
|
|
63
|
-
|
|
64
|
-
_urlListeners: any[];
|
|
60
|
+
getHash(): string;
|
|
65
61
|
$get: (
|
|
66
62
|
| string
|
|
67
63
|
| ((
|
|
68
|
-
$location: import("../../
|
|
69
|
-
$browser: import("../../services/browser.js").Browser,
|
|
64
|
+
$location: import("../../services/location/location.js").Location,
|
|
70
65
|
$rootScope: import("../../core/scope/scope.js").Scope,
|
|
71
66
|
) => UrlService)
|
|
72
67
|
)[];
|
|
73
68
|
/**
|
|
74
|
-
* @returns {
|
|
69
|
+
* @returns {string}
|
|
75
70
|
*/
|
|
76
|
-
html5Mode(): boolean;
|
|
77
71
|
baseHref(): string;
|
|
78
72
|
_baseHref: string;
|
|
79
73
|
/**
|
|
@@ -123,18 +117,13 @@ export class UrlService {
|
|
|
123
117
|
* @param {string} [newUrl] The new value for the URL.
|
|
124
118
|
* This url should reflect only the new internal [[path]], [[search]], and [[hash]] values.
|
|
125
119
|
* It should not include the protocol, site, port, or base path of an absolute HREF.
|
|
126
|
-
* @param {boolean} [replace] When true, replaces the current history entry (instead of appending it) with this new url
|
|
127
120
|
* @param {any} [state] The history's state object, i.e., pushState (if the LocationServices implementation supports it)
|
|
128
121
|
*
|
|
129
122
|
* @return the url (after potentially being processed)
|
|
130
123
|
*/
|
|
131
|
-
url(
|
|
132
|
-
newUrl?: string,
|
|
133
|
-
replace?: boolean,
|
|
134
|
-
state?: any,
|
|
135
|
-
): string | import("../../core/location/location.js").Location;
|
|
124
|
+
url(newUrl?: string, state?: any): any;
|
|
136
125
|
/**
|
|
137
|
-
* @
|
|
126
|
+
* @private
|
|
138
127
|
*
|
|
139
128
|
* Registers a low level url change handler
|
|
140
129
|
*
|
|
@@ -145,20 +134,19 @@ export class UrlService {
|
|
|
145
134
|
* let deregisterFn = locationServices.onChange((evt) => console.log("url change", evt));
|
|
146
135
|
* ```
|
|
147
136
|
*
|
|
148
|
-
* @param callback a function that will be called when the url is changing
|
|
149
|
-
* @return a function that de-registers the callback
|
|
137
|
+
* @param {Function} callback a function that will be called when the url is changing
|
|
138
|
+
* @return {Function} a function that de-registers the callback
|
|
150
139
|
*/
|
|
151
|
-
onChange
|
|
140
|
+
private onChange;
|
|
152
141
|
/**
|
|
153
|
-
* Gets the current URL parts
|
|
142
|
+
* Gets the current URL parts.
|
|
143
|
+
*
|
|
144
|
+
* Returns an object with the `path`, `search`, and `hash` components
|
|
145
|
+
* of the current browser location.
|
|
154
146
|
*
|
|
155
|
-
*
|
|
147
|
+
* @returns {import("../../services/location/interface.ts").UrlParts} The current URL's path, search, and hash.
|
|
156
148
|
*/
|
|
157
|
-
parts():
|
|
158
|
-
path: any;
|
|
159
|
-
search: any;
|
|
160
|
-
hash: string | import("../../core/location/location.js").Location;
|
|
161
|
-
};
|
|
149
|
+
parts(): import("../../services/location/interface.ts").UrlParts;
|
|
162
150
|
/**
|
|
163
151
|
* Activates the best rule for the current URL
|
|
164
152
|
*
|
|
@@ -198,9 +186,9 @@ export class UrlService {
|
|
|
198
186
|
* });
|
|
199
187
|
* ```
|
|
200
188
|
*
|
|
201
|
-
* @param enabled `true` or `false` to start or stop listening to URL changes
|
|
189
|
+
* @param {boolean} enabled `true` or `false` to start or stop listening to URL changes
|
|
202
190
|
*/
|
|
203
|
-
listen(enabled:
|
|
191
|
+
listen(enabled: boolean): any;
|
|
204
192
|
_stopListeningFn: any;
|
|
205
193
|
/**
|
|
206
194
|
* Matches a URL
|
|
@@ -211,7 +199,7 @@ export class UrlService {
|
|
|
211
199
|
*/
|
|
212
200
|
match(url: any): any;
|
|
213
201
|
update(read: any): void;
|
|
214
|
-
location:
|
|
202
|
+
location: any;
|
|
215
203
|
/**
|
|
216
204
|
* Internal API.
|
|
217
205
|
*
|
|
@@ -230,7 +218,7 @@ export class UrlService {
|
|
|
230
218
|
* ```js
|
|
231
219
|
* matcher = $umf.compile("/about/:person");
|
|
232
220
|
* params = { person: "bob" };
|
|
233
|
-
* $bob = $
|
|
221
|
+
* $bob = $url.href(matcher, params);
|
|
234
222
|
* // $bob == "/about/bob";
|
|
235
223
|
* ```
|
|
236
224
|
*
|
|
@@ -13,7 +13,7 @@ export class AnchorScrollProvider {
|
|
|
13
13
|
$get: (
|
|
14
14
|
| string
|
|
15
15
|
| ((
|
|
16
|
-
$location: import("../
|
|
16
|
+
$location: import("../services/location/location.js").Location,
|
|
17
17
|
$rootScope: import("../core/scope/scope.js").Scope,
|
|
18
18
|
) => AnchorScrollFunction)
|
|
19
19
|
)[];
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
*
|
|
42
42
|
* @see {@link angular.ErrorHandler AngularTS ErrorHandler}
|
|
43
43
|
*/
|
|
44
|
-
/** @typedef {import('../
|
|
45
|
-
/** @typedef {import("./
|
|
44
|
+
/** @typedef {import('../log/interface.ts').LogService} LogService */
|
|
45
|
+
/** @typedef {import("./interface.ts").Interface} ErrorHandler */
|
|
46
46
|
/**
|
|
47
47
|
* Provider for `$exceptionHandler` service. Delegates uncaught exceptions to `$log.error()` by default.
|
|
48
48
|
* Can be overridden to implement custom error-handling logic.
|
|
@@ -54,5 +54,5 @@ export class ExceptionHandlerProvider {
|
|
|
54
54
|
errorHandler: ErrorHandler;
|
|
55
55
|
$get: (string | (($log: LogService) => ErrorHandler))[];
|
|
56
56
|
}
|
|
57
|
-
export type LogService = import("../
|
|
58
|
-
export type ErrorHandler = import("./
|
|
57
|
+
export type LogService = import("../log/interface.ts").LogService;
|
|
58
|
+
export type ErrorHandler = import("./interface.ts").Interface;
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @param exception - The exception associated with the error.
|
|
5
5
|
* @param [cause] - Optional information about the context in which the error was thrown.
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
7
|
+
export type Interface = (exception: Error, cause?: string) => void;
|
|
@@ -50,14 +50,59 @@ export class HttpProvider {
|
|
|
50
50
|
* otherwise, returns the current configured value.
|
|
51
51
|
*/
|
|
52
52
|
useApplyAsync: (value?: boolean | undefined) => boolean | any;
|
|
53
|
+
/**
|
|
54
|
+
* Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}
|
|
55
|
+
* pre-processing of request or postprocessing of responses.
|
|
56
|
+
*
|
|
57
|
+
* These service factories are ordered by request, i.e. they are applied in the same order as the
|
|
58
|
+
* array, on request, but reverse order, on response.
|
|
59
|
+
*
|
|
60
|
+
* {@link ng.$http#interceptors Interceptors detailed info}
|
|
61
|
+
*/
|
|
53
62
|
interceptors: any[];
|
|
54
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Array containing URLs whose origins are trusted to receive the XSRF token. See the
|
|
65
|
+
* {@link ng.$http#security-considerations Security Considerations} sections for more details on
|
|
66
|
+
* XSRF.
|
|
67
|
+
*
|
|
68
|
+
* **Note:** An "origin" consists of the [URI scheme](https://en.wikipedia.org/wiki/URI_scheme),
|
|
69
|
+
* the [hostname](https://en.wikipedia.org/wiki/Hostname) and the
|
|
70
|
+
* [port number](https://en.wikipedia.org/wiki/Port_(computer_networking). For `http:` and
|
|
71
|
+
* `https:`, the port number can be omitted if using th default ports (80 and 443 respectively).
|
|
72
|
+
* Examples: `http://example.com`, `https://api.example.com:9876`
|
|
73
|
+
*
|
|
74
|
+
* <div class="alert alert-warning">
|
|
75
|
+
* It is not possible to trust specific URLs/paths. The `path`, `query` and `fragment` parts
|
|
76
|
+
* of a URL will be ignored. For example, `https://foo.com/path/bar?query=baz#fragment` will be
|
|
77
|
+
* treated as `https://foo.com`, meaning that **all** requests to URLs starting with
|
|
78
|
+
* `https://foo.com/` will include the XSRF token.
|
|
79
|
+
* </div>
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
*
|
|
83
|
+
* ```js
|
|
84
|
+
* // App served from `https://example.com/`.
|
|
85
|
+
* angular.
|
|
86
|
+
* module('xsrfTrustedOriginsExample', []).
|
|
87
|
+
* config(['$httpProvider', function($httpProvider) {
|
|
88
|
+
* $httpProvider.xsrfTrustedOrigins.push('https://api.example.com');
|
|
89
|
+
* }]).
|
|
90
|
+
* run(['$http', function($http) {
|
|
91
|
+
* // The XSRF token will be sent.
|
|
92
|
+
* $http.get('https://api.example.com/preferences').then(...);
|
|
93
|
+
*
|
|
94
|
+
* // The XSRF token will NOT be sent.
|
|
95
|
+
* $http.get('https://stats.example.com/activity').then(...);
|
|
96
|
+
* }]);
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @type {string[]}
|
|
100
|
+
*/
|
|
101
|
+
xsrfTrustedOrigins: string[];
|
|
55
102
|
$get: (
|
|
56
103
|
| string
|
|
57
104
|
| ((
|
|
58
|
-
$browser: any,
|
|
59
105
|
$httpBackend: any,
|
|
60
|
-
$rootScope: import("../../core/scope/scope.js").Scope,
|
|
61
106
|
$injector: import("../../core/di/internal-injector.js").InjectorService,
|
|
62
107
|
$sce: any,
|
|
63
108
|
) => {
|
|
@@ -126,14 +126,14 @@ export interface RequestConfig extends RequestShortcutConfig {
|
|
|
126
126
|
}
|
|
127
127
|
| undefined;
|
|
128
128
|
}
|
|
129
|
+
export type HttpResponseStatus = "complete" | "error" | "timeout" | "abort";
|
|
129
130
|
export interface HttpResponse<T> {
|
|
130
131
|
data: T;
|
|
131
132
|
status: number;
|
|
132
133
|
headers: HttpHeadersGetter;
|
|
133
134
|
config: RequestConfig;
|
|
134
135
|
statusText: string;
|
|
135
|
-
|
|
136
|
-
xhrStatus: "complete" | "error" | "timeout" | "abort";
|
|
136
|
+
xhrStatus: HttpResponseStatus;
|
|
137
137
|
}
|
|
138
138
|
export type HttpPromise<T> = Promise<HttpResponse<T>>;
|
|
139
139
|
/**
|