@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
|
@@ -14,11 +14,10 @@ import { $injectTokens, provider } from "../../injection-tokens.js";
|
|
|
14
14
|
*
|
|
15
15
|
* This API is found at `$stateRegistry` ([[UIRouter.stateRegistry]])
|
|
16
16
|
*
|
|
17
|
-
* @implements {ServiceProvider}
|
|
18
17
|
*/
|
|
19
18
|
export class StateRegistryProvider {
|
|
20
|
-
static $inject = provider([
|
|
21
|
-
$injectTokens.$
|
|
19
|
+
/* @ignore */ static $inject = provider([
|
|
20
|
+
$injectTokens.$url,
|
|
22
21
|
$injectTokens.$state,
|
|
23
22
|
$injectTokens.$routerGlobals,
|
|
24
23
|
$injectTokens.$view,
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
silentRejection,
|
|
7
7
|
} from "../../shared/common.js";
|
|
8
8
|
import { isDefined, isObject, isString, minErr } from "../../shared/utils.js";
|
|
9
|
-
import { Queue } from "
|
|
9
|
+
import { Queue } from "../../shared/queue.js";
|
|
10
10
|
import { makeTargetState } from "../path/path-utils.js";
|
|
11
11
|
import { PathNode } from "../path/path-node.js";
|
|
12
12
|
import { defaultTransOpts } from "../transition/transition-service.js";
|
|
13
13
|
import { Rejection, RejectType } from "../transition/reject-factory.js";
|
|
14
14
|
import { TargetState } from "./target-state.js";
|
|
15
15
|
import { Param } from "../params/param.js";
|
|
16
|
-
import { Glob } from "../
|
|
16
|
+
import { Glob } from "../glob/glob.js";
|
|
17
17
|
import { ResolveContext } from "../resolve/resolve-context.js";
|
|
18
18
|
import { lazyLoadState } from "../hooks/lazy-load.js";
|
|
19
19
|
import { val } from "../../shared/hof.js";
|
|
@@ -52,7 +52,10 @@ export class StateProvider {
|
|
|
52
52
|
return this.globals.$current;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
static $inject = [
|
|
55
|
+
/* @ignore */ static $inject = [
|
|
56
|
+
"$routerGlobalsProvider",
|
|
57
|
+
"$transitionsProvider",
|
|
58
|
+
];
|
|
56
59
|
|
|
57
60
|
// Needs access to urlService, stateRegistry
|
|
58
61
|
/**
|
|
@@ -131,9 +134,9 @@ export class StateProvider {
|
|
|
131
134
|
* - **params** `{object}` - returns an array of state params that are ensured to
|
|
132
135
|
* be a super-set of parent's params.
|
|
133
136
|
* - **views** `{object}` - returns a views object where each key is an absolute view
|
|
134
|
-
* name (i.e. "viewName@stateName") and each value is the
|
|
137
|
+
* name (i.e. "viewName@stateName") and each value is the urlConfig object
|
|
135
138
|
* (template, controller) for the view. Even when you don't use the views object
|
|
136
|
-
* explicitly on a state
|
|
139
|
+
* explicitly on a state urlConfig, one is still created for you internally.
|
|
137
140
|
* So by decorating this builder function you have access to decorating template
|
|
138
141
|
* and controller properties.
|
|
139
142
|
* - **ownParams** `{object}` - returns an array of params that belong to the state,
|
|
@@ -151,10 +154,10 @@ export class StateProvider {
|
|
|
151
154
|
* let result = {},
|
|
152
155
|
* views = parent(state);
|
|
153
156
|
*
|
|
154
|
-
* angular.forEach(views, function (
|
|
157
|
+
* angular.forEach(views, function (urlConfig, name) {
|
|
155
158
|
* let autoName = (state.name + '.' + name).replace('.', '/');
|
|
156
|
-
*
|
|
157
|
-
* result[name] =
|
|
159
|
+
* urlConfig.templateUrl = urlConfig.templateUrl || '/partials/' + autoName + '.html';
|
|
160
|
+
* result[name] = urlConfig;
|
|
158
161
|
* });
|
|
159
162
|
* return result;
|
|
160
163
|
* });
|
|
@@ -178,7 +181,7 @@ export class StateProvider {
|
|
|
178
181
|
* @param {object} func A function that is responsible for decorating the original
|
|
179
182
|
* builder function. The function receives two parameters:
|
|
180
183
|
*
|
|
181
|
-
* - `{object}` - state - The state
|
|
184
|
+
* - `{object}` - state - The state urlConfig object.
|
|
182
185
|
* - `{object}` - super - The original builder function.
|
|
183
186
|
*
|
|
184
187
|
* @return {object} $stateProvider - $stateProvider instance
|
|
@@ -411,7 +414,7 @@ export class StateProvider {
|
|
|
411
414
|
const globals = this.globals;
|
|
412
415
|
const latestSuccess = globals.successfulTransitions.peekTail();
|
|
413
416
|
const rootPath = () => [new PathNode(this.stateRegistry.root())];
|
|
414
|
-
return latestSuccess ? latestSuccess.
|
|
417
|
+
return latestSuccess ? latestSuccess._treeChanges.to : rootPath();
|
|
415
418
|
}
|
|
416
419
|
/**
|
|
417
420
|
* Low-level method for transitioning to a new state.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dealoc } from "../../shared/dom.js";
|
|
2
|
-
import { Angular } from "../../
|
|
2
|
+
import { Angular } from "../../angular.js";
|
|
3
3
|
import { isFunction } from "../../shared/utils.js";
|
|
4
4
|
import { wait } from "../../shared/test-utils.js";
|
|
5
5
|
|
|
@@ -101,8 +101,9 @@ describe("$state", () => {
|
|
|
101
101
|
// some tests are polluting the cache
|
|
102
102
|
window.angular = new Angular();
|
|
103
103
|
module = window.angular.module("defaultModule", []);
|
|
104
|
-
module.config((_$stateProvider_, _$provide_) => {
|
|
104
|
+
module.config((_$stateProvider_, _$provide_, _$locationProvider_) => {
|
|
105
105
|
$stateProvider = _$stateProvider_;
|
|
106
|
+
_$locationProvider_.html5ModeConf.enabled = false;
|
|
106
107
|
});
|
|
107
108
|
window.angular.bootstrap(document.getElementById("app"), [
|
|
108
109
|
"defaultModule",
|
|
@@ -143,10 +144,10 @@ describe("$state", () => {
|
|
|
143
144
|
dealoc(document.getElementById("app"));
|
|
144
145
|
window.angular = new Angular();
|
|
145
146
|
module = window.angular.module("defaultModule", []);
|
|
146
|
-
module.config((_$stateProvider_, _$provide_) => {
|
|
147
|
+
module.config((_$stateProvider_, _$provide_, _$locationProvider_) => {
|
|
147
148
|
$stateProvider = _$stateProvider_;
|
|
148
149
|
$provide = _$provide_;
|
|
149
|
-
|
|
150
|
+
_$locationProvider_.html5ModeConf.enabled = false;
|
|
150
151
|
[A, B, C, D, DD, E, H, HH, HHH].forEach(function (state) {
|
|
151
152
|
state.onEnter = callbackLogger(state, "onEnter");
|
|
152
153
|
state.onExit = callbackLogger(state, "onExit");
|
|
@@ -457,7 +458,7 @@ describe("$state", () => {
|
|
|
457
458
|
}).forEach(([k, v]) => {
|
|
458
459
|
expect($stateParams[k]).toEqual(v);
|
|
459
460
|
});
|
|
460
|
-
expect($location.
|
|
461
|
+
expect($location.getUrl()).toEqual(
|
|
461
462
|
"/dynstate/p1/pd1?search=s1&searchDyn=sd1",
|
|
462
463
|
);
|
|
463
464
|
});
|
|
@@ -617,14 +618,14 @@ describe("$state", () => {
|
|
|
617
618
|
});
|
|
618
619
|
|
|
619
620
|
it("does not exit nor enter a state when only dynamic params change (triggered via url)", async () => {
|
|
620
|
-
$location.
|
|
621
|
+
$location.setSearch({ search: "s1", searchDyn: "sd2" });
|
|
621
622
|
$rootScope.$broadcast("$locationChangeSuccess");
|
|
622
623
|
await wait(100);
|
|
623
624
|
expect(dynlog).toBe("success;[searchDyn=sd2];");
|
|
624
625
|
});
|
|
625
626
|
|
|
626
627
|
it("exits and enters a state when any non-dynamic params change (triggered via url)", async () => {
|
|
627
|
-
$location.
|
|
628
|
+
$location.setSearch({ search: "s2", searchDyn: "sd2" });
|
|
628
629
|
$rootScope.$broadcast("$locationChangeSuccess");
|
|
629
630
|
await wait(100);
|
|
630
631
|
expect(dynlog).toBe("exit:dyn;enter:dyn;success;");
|
|
@@ -650,23 +651,23 @@ describe("$state", () => {
|
|
|
650
651
|
});
|
|
651
652
|
});
|
|
652
653
|
|
|
653
|
-
it("updates $stateParams and $location.
|
|
654
|
-
$location.
|
|
654
|
+
it("updates $stateParams and $location.setSearch when only dynamic params change (triggered via url)", async () => {
|
|
655
|
+
$location.setSearch({ search: "s1", searchDyn: "sd2" });
|
|
655
656
|
$rootScope.$broadcast("$locationChangeSuccess");
|
|
656
657
|
await wait(100);
|
|
657
658
|
expect($stateParams.search).toBe("s1");
|
|
658
659
|
expect($stateParams.searchDyn).toBe("sd2");
|
|
659
|
-
expect($location.
|
|
660
|
+
expect($location.getSearch()).toEqual({
|
|
660
661
|
search: "s1",
|
|
661
662
|
searchDyn: "sd2",
|
|
662
663
|
});
|
|
663
664
|
});
|
|
664
665
|
|
|
665
|
-
it("updates $stateParams and $location.
|
|
666
|
+
it("updates $stateParams and $location.setSearch when only dynamic params change (triggered via $state transition)", async () => {
|
|
666
667
|
await $state.go(".", { searchDyn: "sd2" });
|
|
667
668
|
expect($stateParams.search).toBe("s1");
|
|
668
669
|
expect($stateParams.searchDyn).toBe("sd2");
|
|
669
|
-
expect($location.
|
|
670
|
+
expect($location.getSearch()).toEqual({
|
|
670
671
|
search: "s1",
|
|
671
672
|
searchDyn: "sd2",
|
|
672
673
|
});
|
|
@@ -683,7 +684,7 @@ describe("$state", () => {
|
|
|
683
684
|
// observedParamValue = newval;
|
|
684
685
|
// });
|
|
685
686
|
// await wait(100);
|
|
686
|
-
// $location.
|
|
687
|
+
// $location.setSearch({ search: "s1", searchDyn: "sd2" });
|
|
687
688
|
// $rootScope.$broadcast("$locationChangeSuccess");
|
|
688
689
|
|
|
689
690
|
// await wait(100);
|
|
@@ -806,7 +807,7 @@ describe("$state", () => {
|
|
|
806
807
|
// this passes in isolation
|
|
807
808
|
it("updates $stateParams", async () => {
|
|
808
809
|
await initStateTo(RS);
|
|
809
|
-
$location.
|
|
810
|
+
$location.setSearch({ term: "hello" });
|
|
810
811
|
$rootScope.$broadcast("$locationChangeSuccess");
|
|
811
812
|
await wait(100);
|
|
812
813
|
expect($stateParams.term).toEqual("hello");
|
|
@@ -814,10 +815,10 @@ describe("$state", () => {
|
|
|
814
815
|
});
|
|
815
816
|
|
|
816
817
|
it("doesn't re-enter state (triggered by url change)", async () => {
|
|
817
|
-
$location.
|
|
818
|
+
$location.setSearch({ term: "hello" });
|
|
818
819
|
$rootScope.$broadcast("$locationChangeSuccess");
|
|
819
820
|
|
|
820
|
-
expect($location.
|
|
821
|
+
expect($location.getSearch()).toEqual({ term: "hello" });
|
|
821
822
|
expect(entered).toBeFalsy();
|
|
822
823
|
});
|
|
823
824
|
|
|
@@ -833,7 +834,7 @@ describe("$state", () => {
|
|
|
833
834
|
expect($state.current).toBe(RS);
|
|
834
835
|
expect(entered).toBeFalsy();
|
|
835
836
|
expect(success).toBeTruthy();
|
|
836
|
-
expect($location.
|
|
837
|
+
expect($location.getSearch()).toEqual({ term: "hello" });
|
|
837
838
|
});
|
|
838
839
|
|
|
839
840
|
it("updates URL when (triggered by $state transition)", async () => {
|
|
@@ -841,7 +842,7 @@ describe("$state", () => {
|
|
|
841
842
|
await $state.go(".", { term: "goodbye" });
|
|
842
843
|
|
|
843
844
|
expect($stateParams.term).toEqual("goodbye");
|
|
844
|
-
expect($location.
|
|
845
|
+
expect($location.getUrl()).toEqual("/search?term=goodbye");
|
|
845
846
|
expect(entered).toBeFalsy();
|
|
846
847
|
});
|
|
847
848
|
});
|
|
@@ -976,19 +977,19 @@ describe("$state", () => {
|
|
|
976
977
|
|
|
977
978
|
it("updates the location #fragment", async () => {
|
|
978
979
|
await $state.transitionTo("home.item", { id: "world", "#": "frag" });
|
|
979
|
-
expect($location.
|
|
980
|
-
expect($location.
|
|
980
|
+
expect($location.getUrl()).toBe("/front/world#frag");
|
|
981
|
+
expect($location.getHash()).toBe("frag");
|
|
981
982
|
});
|
|
982
983
|
|
|
983
984
|
// passes in isolation. on success callback being polluted
|
|
984
985
|
it("runs a transition when the location #fragment is updated", async () => {
|
|
985
986
|
$state.transitionTo("home.item", { id: "world", "#": "frag" });
|
|
986
987
|
await wait(100);
|
|
987
|
-
expect($location.
|
|
988
|
+
expect($location.getHash()).toBe("frag");
|
|
988
989
|
|
|
989
990
|
$state.transitionTo("home.item", { id: "world", "#": "blarg" });
|
|
990
991
|
await wait(100);
|
|
991
|
-
expect($location.
|
|
992
|
+
expect($location.getHash()).toBe("blarg");
|
|
992
993
|
});
|
|
993
994
|
|
|
994
995
|
it("injects $transition$ into resolves", async () => {
|
|
@@ -5,6 +5,7 @@ const TEST_URL = "src/router/state/state.html?random=false";
|
|
|
5
5
|
test("unit tests contain no errors", async ({ page }) => {
|
|
6
6
|
await page.goto(TEST_URL);
|
|
7
7
|
await page.content();
|
|
8
|
+
await page.waitForTimeout(1000);
|
|
8
9
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
9
10
|
/0 failures/,
|
|
10
11
|
);
|
|
@@ -64,7 +64,7 @@ export function ng1ViewsBuilder(state) {
|
|
|
64
64
|
name = name || "$default";
|
|
65
65
|
// Account for views: { header: "headerComponent" }
|
|
66
66
|
if (isString(config)) config = { component: config };
|
|
67
|
-
// Make a shallow copy of the
|
|
67
|
+
// Make a shallow copy of the urlConfig object
|
|
68
68
|
config = Object.assign({}, config);
|
|
69
69
|
// Do not allow a view to mix props for component-style view with props for template/controller-style view
|
|
70
70
|
if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { $injectTokens as $t } from "../injection-tokens.js";
|
|
2
|
+
|
|
3
|
+
$IsStateFilter.$inject = [$t.$state];
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* `isState` Filter: truthy if the current state is the parameter
|
|
3
7
|
*
|
|
@@ -7,18 +11,19 @@
|
|
|
7
11
|
* ```html
|
|
8
12
|
* <div ng-if="'stateName' | isState">show if state is 'stateName'</div>
|
|
9
13
|
* ```
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {import('./state/state-service.js').StateProvider} $state
|
|
13
16
|
* @returns {import('../interface.ts').FilterFn}
|
|
14
17
|
*/
|
|
15
18
|
export function $IsStateFilter($state) {
|
|
16
|
-
const isFilter =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
//isFilter.$stateful = true;
|
|
19
|
+
const isFilter = (state, params, options) =>
|
|
20
|
+
$state.is(state, params, options);
|
|
21
|
+
isFilter.$stateful = true;
|
|
20
22
|
return isFilter;
|
|
21
23
|
}
|
|
24
|
+
|
|
25
|
+
$IncludedByStateFilter.$inject = [$t.$state];
|
|
26
|
+
|
|
22
27
|
/**
|
|
23
28
|
* `includedByState` Filter: truthy if the current state includes the parameter
|
|
24
29
|
*
|
|
@@ -28,15 +33,14 @@ export function $IsStateFilter($state) {
|
|
|
28
33
|
* ```html
|
|
29
34
|
* <div ng-if="'fullOrPartialStateName' | includedByState">show if state includes 'fullOrPartialStateName'</div>
|
|
30
35
|
* ```
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/**
|
|
36
|
+
*
|
|
37
|
+
* @param {import('./state/state-service.js').StateProvider} $state
|
|
34
38
|
* @returns {import('../interface.ts').FilterFn}
|
|
35
39
|
*/
|
|
36
40
|
export function $IncludedByStateFilter($state) {
|
|
37
41
|
const includesFilter = function (state, params, options) {
|
|
38
42
|
return $state.includes(state, params, options);
|
|
39
43
|
};
|
|
40
|
-
|
|
44
|
+
includesFilter.$stateful = true;
|
|
41
45
|
return includesFilter;
|
|
42
46
|
}
|
|
@@ -4,6 +4,7 @@ import { Resolvable } from "./resolve/resolvable.js";
|
|
|
4
4
|
import { kebobString } from "../shared/strings.js";
|
|
5
5
|
import { annotate } from "../core/di/injector.js";
|
|
6
6
|
import { DirectiveSuffix } from "../core/compile/compile.js";
|
|
7
|
+
import { $injectTokens as $t } from "../injection-tokens.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @typedef BindingTuple
|
|
@@ -21,10 +22,10 @@ export class TemplateFactoryProvider {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
$get = [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
$t.$http,
|
|
26
|
+
$t.$templateCache,
|
|
27
|
+
$t.$templateRequest,
|
|
28
|
+
$t.$injector,
|
|
28
29
|
/**
|
|
29
30
|
* @param {import("interface.ts").HttpService} $http
|
|
30
31
|
* @param {import("../services/template-cache/interface.ts").TemplateCache} $templateCache
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { removeFrom, tail, map } from "../../shared/common.js";
|
|
2
2
|
import { isString, isFunction } from "../../shared/utils.js";
|
|
3
|
-
import { Glob } from "../
|
|
3
|
+
import { Glob } from "../glob/glob.js";
|
|
4
4
|
import { TransitionHookScope } from "./interface.js";
|
|
5
5
|
/**
|
|
6
6
|
* Determines if the given state matches the matchCriteria
|
|
@@ -31,6 +31,7 @@ import { registerIgnoredTransitionHook } from "../hooks/ignored-transition.js";
|
|
|
31
31
|
import { registerInvalidTransitionHook } from "../hooks/invalid-transition.js";
|
|
32
32
|
import { registerRedirectToHook } from "../hooks/redirect-to.js";
|
|
33
33
|
import { registerUpdateUrl } from "../hooks/url.js";
|
|
34
|
+
import { $injectTokens as $t, provider } from "../../injection-tokens.js";
|
|
34
35
|
/**
|
|
35
36
|
* The default [[Transition]] options.
|
|
36
37
|
*
|
|
@@ -61,7 +62,7 @@ export let defaultTransOpts = {
|
|
|
61
62
|
* This API is located at `router.transitionService` ([[UIRouter.transitionService]])
|
|
62
63
|
*/
|
|
63
64
|
export class TransitionProvider {
|
|
64
|
-
static $inject = [
|
|
65
|
+
/* @ignore */ static $inject = provider([$t.$routerGlobals, $t.$view]);
|
|
65
66
|
|
|
66
67
|
/**
|
|
67
68
|
* @param {import('../globals.js').RouterGlobals} globals
|
|
@@ -92,10 +93,10 @@ export class TransitionProvider {
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
$get = [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
$t.$state,
|
|
97
|
+
$t.$url,
|
|
98
|
+
$t.$stateRegistry,
|
|
99
|
+
$t.$view,
|
|
99
100
|
(stateService, urlService, stateRegistry, viewService) => {
|
|
100
101
|
// Lazy load state trees
|
|
101
102
|
this._deregisterHookFns.lazyLoad = registerLazyLoadHook(
|
|
@@ -40,9 +40,9 @@ export class Transition {
|
|
|
40
40
|
*
|
|
41
41
|
* If the target state is not valid, an error is thrown.
|
|
42
42
|
*
|
|
43
|
-
* @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`
|
|
43
|
+
* @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`
|
|
44
44
|
* encapsulates the "from state".
|
|
45
|
-
* @param targetState The target state and parameters being transitioned to (also, the transition options)
|
|
45
|
+
* @param {import('../state/target-state.js').TargetState} targetState The target state and parameters being transitioned to (also, the transition options)
|
|
46
46
|
* @param {import('../transition/transition-service.js').TransitionProvider} transitionService The [[TransitionService]] instance
|
|
47
47
|
* @param {import('../globals.js').RouterGlobals} globals
|
|
48
48
|
*/
|
|
@@ -586,8 +586,8 @@ export class Transition {
|
|
|
586
586
|
).length
|
|
587
587
|
);
|
|
588
588
|
};
|
|
589
|
-
const newTC = this.
|
|
590
|
-
const pendTC = pending && pending.
|
|
589
|
+
const newTC = this._treeChanges;
|
|
590
|
+
const pendTC = pending && pending._treeChanges;
|
|
591
591
|
if (
|
|
592
592
|
pendTC &&
|
|
593
593
|
same(pendTC.to, newTC.to) &&
|
|
@@ -334,9 +334,9 @@ export class UrlMatcher {
|
|
|
334
334
|
* // returns { id: 'bob', q: 'hello', r: null }
|
|
335
335
|
* ```
|
|
336
336
|
*
|
|
337
|
-
* @param path The URL path to match, e.g. `$location.
|
|
338
|
-
* @param search URL search parameters, e.g. `$location.
|
|
339
|
-
* @param hash URL hash e.g. `$location.
|
|
337
|
+
* @param path The URL path to match, e.g. `$location.getPath()`.
|
|
338
|
+
* @param search URL search parameters, e.g. `$location.getSearch()`.
|
|
339
|
+
* @param hash URL hash e.g. `$location.getHash()`.
|
|
340
340
|
*
|
|
341
341
|
* @returns The captured parameter values.
|
|
342
342
|
*/
|
|
@@ -5,7 +5,9 @@ import { isDefined, isFunction, isString } from "../../shared/utils.js";
|
|
|
5
5
|
import { removeFrom } from "../../shared/common.js";
|
|
6
6
|
import { UrlRuleFactory } from "./url-rule.js";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function prioritySort(a, b) {
|
|
9
|
+
return (b.priority || 0) - (a.priority || 0);
|
|
10
|
+
}
|
|
9
11
|
|
|
10
12
|
const typeSort = (a, b) => {
|
|
11
13
|
const weights = { STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1 };
|
|
@@ -36,8 +38,7 @@ const idSort = (a, b) => {
|
|
|
36
38
|
* - Equally sorted State and UrlMatcher rules will each match the URL.
|
|
37
39
|
* Then, the *best* match is chosen based on how many parameter values were matched.
|
|
38
40
|
*/
|
|
39
|
-
|
|
40
|
-
defaultRuleSortFn = (a, b) => {
|
|
41
|
+
function defaultRuleSortFn(a, b) {
|
|
41
42
|
let cmp = prioritySort(a, b);
|
|
42
43
|
if (cmp !== 0) return cmp;
|
|
43
44
|
cmp = typeSort(a, b);
|
|
@@ -45,7 +46,8 @@ defaultRuleSortFn = (a, b) => {
|
|
|
45
46
|
cmp = urlMatcherSort(a, b);
|
|
46
47
|
if (cmp !== 0) return cmp;
|
|
47
48
|
return idSort(a, b);
|
|
48
|
-
}
|
|
49
|
+
}
|
|
50
|
+
|
|
49
51
|
function getHandlerFn(handler) {
|
|
50
52
|
if (
|
|
51
53
|
!isFunction(handler) &&
|
|
@@ -67,9 +69,10 @@ function getHandlerFn(handler) {
|
|
|
67
69
|
*
|
|
68
70
|
* The most commonly used methods are [[otherwise]] and [[when]].
|
|
69
71
|
*
|
|
70
|
-
* This API is found at `$
|
|
72
|
+
* This API is found at `$url.rules` (see: [[UIRouter.urlService]], [[URLService.rules]])
|
|
71
73
|
*/
|
|
72
74
|
export class UrlRules {
|
|
75
|
+
/** @param {UrlRuleFactory} urlRuleFactory */
|
|
73
76
|
constructor(urlRuleFactory) {
|
|
74
77
|
this._sortFn = defaultRuleSortFn;
|
|
75
78
|
this._rules = [];
|