@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
package/src/core/di/ng-module.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { $injectTokens } from "../../injection-tokens.js";
|
|
1
|
+
import { $injectTokens as $t } from "../../injection-tokens.js";
|
|
2
2
|
import { isFunction, isString, assert } from "../../shared/utils.js";
|
|
3
3
|
|
|
4
|
+
/** @private */
|
|
4
5
|
export const INJECTOR_LITERAL = "$injector";
|
|
6
|
+
/** @private */
|
|
5
7
|
export const COMPILE_LITERAL = "$compileProvider";
|
|
8
|
+
/** @private */
|
|
6
9
|
export const ANIMATION_LITERAL = "$animateProvider";
|
|
10
|
+
/** @private */
|
|
7
11
|
export const FILTER_LITERAL = "$filterProvider";
|
|
12
|
+
/** @private */
|
|
8
13
|
export const CONTROLLER_LITERAL = "$controllerProvider";
|
|
9
14
|
|
|
10
15
|
/**
|
|
@@ -61,7 +66,7 @@ export class NgModule {
|
|
|
61
66
|
* @returns {NgModule}
|
|
62
67
|
*/
|
|
63
68
|
value(name, object) {
|
|
64
|
-
this.invokeQueue.push([$
|
|
69
|
+
this.invokeQueue.push([$t.$provide, "value", [name, object]]);
|
|
65
70
|
return this;
|
|
66
71
|
}
|
|
67
72
|
|
|
@@ -71,11 +76,7 @@ export class NgModule {
|
|
|
71
76
|
* @returns {NgModule}
|
|
72
77
|
*/
|
|
73
78
|
constant(name, object) {
|
|
74
|
-
this.invokeQueue.unshift([
|
|
75
|
-
$injectTokens.$provide,
|
|
76
|
-
"constant",
|
|
77
|
-
[name, object],
|
|
78
|
-
]);
|
|
79
|
+
this.invokeQueue.unshift([$t.$provide, "constant", [name, object]]);
|
|
79
80
|
return this;
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -120,11 +121,7 @@ export class NgModule {
|
|
|
120
121
|
if (providerFunction && isFunction(providerFunction)) {
|
|
121
122
|
providerFunction.$$moduleName = name;
|
|
122
123
|
}
|
|
123
|
-
this.invokeQueue.push([
|
|
124
|
-
$injectTokens.$provide,
|
|
125
|
-
"factory",
|
|
126
|
-
[name, providerFunction],
|
|
127
|
-
]);
|
|
124
|
+
this.invokeQueue.push([$t.$provide, "factory", [name, providerFunction]]);
|
|
128
125
|
return this;
|
|
129
126
|
}
|
|
130
127
|
|
|
@@ -137,11 +134,7 @@ export class NgModule {
|
|
|
137
134
|
if (serviceFunction && isFunction(serviceFunction)) {
|
|
138
135
|
serviceFunction.$$moduleName = name;
|
|
139
136
|
}
|
|
140
|
-
this.invokeQueue.push([
|
|
141
|
-
$injectTokens.$provide,
|
|
142
|
-
"service",
|
|
143
|
-
[name, serviceFunction],
|
|
144
|
-
]);
|
|
137
|
+
this.invokeQueue.push([$t.$provide, "service", [name, serviceFunction]]);
|
|
145
138
|
return this;
|
|
146
139
|
}
|
|
147
140
|
|
|
@@ -154,11 +147,7 @@ export class NgModule {
|
|
|
154
147
|
if (providerType && isFunction(providerType)) {
|
|
155
148
|
providerType.$$moduleName = name;
|
|
156
149
|
}
|
|
157
|
-
this.invokeQueue.push([
|
|
158
|
-
$injectTokens.$provide,
|
|
159
|
-
"provider",
|
|
160
|
-
[name, providerType],
|
|
161
|
-
]);
|
|
150
|
+
this.invokeQueue.push([$t.$provide, "provider", [name, providerType]]);
|
|
162
151
|
return this;
|
|
163
152
|
}
|
|
164
153
|
|
|
@@ -171,11 +160,7 @@ export class NgModule {
|
|
|
171
160
|
if (decorFn && isFunction(decorFn)) {
|
|
172
161
|
decorFn.$$moduleName = name;
|
|
173
162
|
}
|
|
174
|
-
this.configBlocks.push([
|
|
175
|
-
$injectTokens.$provide,
|
|
176
|
-
"decorator",
|
|
177
|
-
[name, decorFn],
|
|
178
|
-
]);
|
|
163
|
+
this.configBlocks.push([$t.$provide, "decorator", [name, decorFn]]);
|
|
179
164
|
return this;
|
|
180
165
|
}
|
|
181
166
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { $injectTokens as $t } from "../../injection-tokens.js";
|
|
1
2
|
import { isObject } from "../../shared/utils.js";
|
|
2
3
|
import { filterFilter } from "../../filters/filter.js";
|
|
3
4
|
import { jsonFilter } from "../../filters/filters.js";
|
|
@@ -8,48 +9,47 @@ import {
|
|
|
8
9
|
$IsStateFilter,
|
|
9
10
|
} from "../../router/state-filters.js";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
const SUFFIX = "Filter";
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export class FilterProvider {
|
|
15
|
+
/* @ignore */ static $inject = [$t.$provide];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {import('../../interface.ts').Provider} $provide
|
|
19
|
+
*/
|
|
20
|
+
constructor($provide) {
|
|
21
|
+
this.$provide = $provide;
|
|
22
|
+
this.register({
|
|
23
|
+
filter: filterFilter,
|
|
24
|
+
json: jsonFilter,
|
|
25
|
+
limitTo: limitToFilter,
|
|
26
|
+
orderBy: orderByFilter,
|
|
27
|
+
isState: $IsStateFilter,
|
|
28
|
+
includedByState: $IncludedByStateFilter,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
18
31
|
|
|
19
32
|
/**
|
|
20
33
|
* @param {string|Record<string, import('../../interface.ts').FilterFactory>} name
|
|
21
|
-
* @param {import('../../interface.ts').FilterFactory} factory
|
|
22
|
-
* @return {import('../../interface.ts').
|
|
34
|
+
* @param {import('../../interface.ts').FilterFactory} [factory]
|
|
35
|
+
* @return {import('../../interface.ts').Provider}
|
|
23
36
|
*/
|
|
24
|
-
|
|
37
|
+
register(name, factory) {
|
|
25
38
|
if (isObject(name)) {
|
|
26
39
|
const filters = {};
|
|
27
40
|
Object.entries(name).forEach(([key, filter]) => {
|
|
28
|
-
filters[key] = register(key, filter);
|
|
41
|
+
filters[key] = this.register(key, filter);
|
|
29
42
|
});
|
|
30
43
|
}
|
|
31
|
-
return
|
|
44
|
+
return this.$provide.factory(name + SUFFIX, factory);
|
|
32
45
|
}
|
|
33
46
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.$get = [
|
|
37
|
-
"$injector",
|
|
47
|
+
$get = [
|
|
48
|
+
$t.$injector,
|
|
38
49
|
/**
|
|
39
50
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
40
|
-
* @returns
|
|
51
|
+
* @returns {import('../../interface.ts').FilterFn}
|
|
41
52
|
*/
|
|
42
|
-
|
|
43
|
-
return function (name) {
|
|
44
|
-
return $injector.get(name + suffix);
|
|
45
|
-
};
|
|
46
|
-
},
|
|
53
|
+
($injector) => (/** @type {string} */ name) => $injector.get(name + SUFFIX),
|
|
47
54
|
];
|
|
48
|
-
|
|
49
|
-
register("filter", filterFilter);
|
|
50
|
-
register("json", jsonFilter);
|
|
51
|
-
register("limitTo", limitToFilter);
|
|
52
|
-
register("orderBy", orderByFilter);
|
|
53
|
-
register("isState", $IsStateFilter);
|
|
54
|
-
register("includedByState", $IncludedByStateFilter);
|
|
55
55
|
}
|
|
@@ -5,6 +5,7 @@ const TEST_URL = "src/core/filter/filter.html";
|
|
|
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
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
extend,
|
|
3
3
|
isDefined,
|
|
4
4
|
isUndefined,
|
|
5
|
+
minErr,
|
|
5
6
|
stringify,
|
|
6
|
-
extend,
|
|
7
7
|
} from "../../shared/utils.js";
|
|
8
8
|
import { constantWatchDelegate } from "../parse/parse.js";
|
|
9
9
|
|
|
@@ -322,8 +322,7 @@ export class InterpolateProvider {
|
|
|
322
322
|
let j = 0;
|
|
323
323
|
for (; j < ii; j++) {
|
|
324
324
|
let fn = parseFns[j];
|
|
325
|
-
|
|
326
|
-
vals[j] = res;
|
|
325
|
+
vals[j] = fn(context);
|
|
327
326
|
}
|
|
328
327
|
cb(compute(vals));
|
|
329
328
|
});
|
|
@@ -332,8 +331,7 @@ export class InterpolateProvider {
|
|
|
332
331
|
values[i] = parseFns[i](context);
|
|
333
332
|
}
|
|
334
333
|
|
|
335
|
-
|
|
336
|
-
return res;
|
|
334
|
+
return compute(values);
|
|
337
335
|
} catch (err) {
|
|
338
336
|
interr(text, err);
|
|
339
337
|
}
|
|
@@ -5,6 +5,7 @@ const TEST_URL = "src/core/interpolate/interpolate.html";
|
|
|
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
|
);
|
|
@@ -2,7 +2,7 @@ import { AST } from "./ast.js";
|
|
|
2
2
|
import { Lexer } from "../lexer/lexer.js";
|
|
3
3
|
import { createInjector } from "../../di/injector.js";
|
|
4
4
|
import { ASTType } from "../ast-type.js";
|
|
5
|
-
import { Angular } from "../../../
|
|
5
|
+
import { Angular } from "../../../angular.js";
|
|
6
6
|
|
|
7
7
|
describe("ast", () => {
|
|
8
8
|
let $rootScope;
|
|
@@ -3,7 +3,7 @@ import { test, expect } from "@playwright/test";
|
|
|
3
3
|
test("lexer unit tests contain no errors", async ({ page }) => {
|
|
4
4
|
await page.goto("src/core/parse/ast/ast.html");
|
|
5
5
|
await page.content();
|
|
6
|
-
await page.waitForTimeout(
|
|
6
|
+
await page.waitForTimeout(3000);
|
|
7
7
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
8
8
|
/0 failures/,
|
|
9
9
|
);
|
|
@@ -137,7 +137,7 @@ export class ASTInterpreter {
|
|
|
137
137
|
if (ast.filter) right = this.$filter(ast.callee.name);
|
|
138
138
|
if (!ast.filter) right = this.recurse(ast.callee, true);
|
|
139
139
|
return ast.filter
|
|
140
|
-
?
|
|
140
|
+
? (scope, locals, assign) => {
|
|
141
141
|
const values = [];
|
|
142
142
|
for (let i = 0; i < args.length; ++i) {
|
|
143
143
|
const res = args[i](scope, locals, assign);
|
|
@@ -150,7 +150,7 @@ export class ASTInterpreter {
|
|
|
150
150
|
? { context: undefined, name: undefined, value }
|
|
151
151
|
: value;
|
|
152
152
|
}
|
|
153
|
-
:
|
|
153
|
+
: (scope, locals, assign) => {
|
|
154
154
|
const rhs = right(scope, locals, assign);
|
|
155
155
|
let value;
|
|
156
156
|
if (rhs.value != null && isFunction(rhs.value)) {
|
|
@@ -166,7 +166,7 @@ export class ASTInterpreter {
|
|
|
166
166
|
case ASTType.AssignmentExpression:
|
|
167
167
|
left = this.recurse(ast.left, true, 1);
|
|
168
168
|
right = this.recurse(ast.right);
|
|
169
|
-
return
|
|
169
|
+
return (scope, locals, assign) => {
|
|
170
170
|
const lhs = left(scope, locals, assign);
|
|
171
171
|
const rhs = right(scope, locals, assign);
|
|
172
172
|
lhs.context[lhs.name] = rhs;
|
|
@@ -177,7 +177,7 @@ export class ASTInterpreter {
|
|
|
177
177
|
ast.elements.forEach((expr) => {
|
|
178
178
|
args.push(self.recurse(expr));
|
|
179
179
|
});
|
|
180
|
-
return
|
|
180
|
+
return (scope, locals, assign) => {
|
|
181
181
|
const value = [];
|
|
182
182
|
for (let i = 0; i < args.length; ++i) {
|
|
183
183
|
value.push(args[i](scope, locals, assign));
|
|
@@ -204,7 +204,7 @@ export class ASTInterpreter {
|
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
|
-
return
|
|
207
|
+
return (scope, locals, assign) => {
|
|
208
208
|
const value = {};
|
|
209
209
|
for (let i = 0; i < args.length; ++i) {
|
|
210
210
|
if (args[i].computed) {
|
|
@@ -220,17 +220,12 @@ export class ASTInterpreter {
|
|
|
220
220
|
return context ? { value } : value;
|
|
221
221
|
};
|
|
222
222
|
case ASTType.ThisExpression:
|
|
223
|
-
return
|
|
224
|
-
return context ? { value: scope } : scope;
|
|
225
|
-
};
|
|
223
|
+
return (scope) => (context ? { value: scope } : scope);
|
|
226
224
|
case ASTType.LocalsExpression:
|
|
227
|
-
return
|
|
228
|
-
return context ? { value: locals } : locals;
|
|
229
|
-
};
|
|
225
|
+
return (scope, locals) => (context ? { value: locals } : locals);
|
|
230
226
|
case ASTType.NGValueParameter:
|
|
231
|
-
return
|
|
232
|
-
|
|
233
|
-
};
|
|
227
|
+
return (scope, locals, assign) =>
|
|
228
|
+
context ? { value: assign } : assign;
|
|
234
229
|
}
|
|
235
230
|
}
|
|
236
231
|
|
|
@@ -241,7 +236,7 @@ export class ASTInterpreter {
|
|
|
241
236
|
* @returns {function} The unary plus function.
|
|
242
237
|
*/
|
|
243
238
|
"unary+"(argument, context) {
|
|
244
|
-
return
|
|
239
|
+
return (scope, locals, assign) => {
|
|
245
240
|
let arg = argument(scope, locals, assign);
|
|
246
241
|
if (isDefined(arg)) {
|
|
247
242
|
arg = +arg;
|
|
@@ -259,7 +254,7 @@ export class ASTInterpreter {
|
|
|
259
254
|
* @returns {function} The unary minus function.
|
|
260
255
|
*/
|
|
261
256
|
"unary-"(argument, context) {
|
|
262
|
-
return
|
|
257
|
+
return (scope, locals, assign) => {
|
|
263
258
|
let arg = argument(scope, locals, assign);
|
|
264
259
|
if (isDefined(arg)) {
|
|
265
260
|
arg = -arg;
|
|
@@ -277,7 +272,7 @@ export class ASTInterpreter {
|
|
|
277
272
|
* @returns {function} The unary negation function.
|
|
278
273
|
*/
|
|
279
274
|
"unary!"(argument, context) {
|
|
280
|
-
return
|
|
275
|
+
return (scope, locals, assign) => {
|
|
281
276
|
const arg = !argument(scope, locals, assign);
|
|
282
277
|
return context ? { value: arg } : arg;
|
|
283
278
|
};
|
|
@@ -291,7 +286,7 @@ export class ASTInterpreter {
|
|
|
291
286
|
* @returns {function} The binary plus function.
|
|
292
287
|
*/
|
|
293
288
|
"binary+"(left, right, context) {
|
|
294
|
-
return
|
|
289
|
+
return (scope, locals, assign) => {
|
|
295
290
|
const lhs = left(scope, locals, assign);
|
|
296
291
|
const rhs = right(scope, locals, assign);
|
|
297
292
|
const arg = plusFn(lhs, rhs);
|
|
@@ -307,7 +302,7 @@ export class ASTInterpreter {
|
|
|
307
302
|
* @returns {function} The binary minus function.
|
|
308
303
|
*/
|
|
309
304
|
"binary-"(left, right, context) {
|
|
310
|
-
return
|
|
305
|
+
return (scope, locals, assign) => {
|
|
311
306
|
const lhs = left(scope, locals, assign);
|
|
312
307
|
const rhs = right(scope, locals, assign);
|
|
313
308
|
const arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);
|
|
@@ -323,14 +318,14 @@ export class ASTInterpreter {
|
|
|
323
318
|
* @returns {function} The binary multiplication function.
|
|
324
319
|
*/
|
|
325
320
|
"binary*"(left, right, context) {
|
|
326
|
-
return
|
|
321
|
+
return (scope, locals, assign) => {
|
|
327
322
|
const arg = left(scope, locals, assign) * right(scope, locals, assign);
|
|
328
323
|
return context ? { value: arg } : arg;
|
|
329
324
|
};
|
|
330
325
|
}
|
|
331
326
|
|
|
332
327
|
"binary/"(left, right, context) {
|
|
333
|
-
return
|
|
328
|
+
return (scope, locals, assign) => {
|
|
334
329
|
const arg = left(scope, locals, assign) / right(scope, locals, assign);
|
|
335
330
|
return context ? { value: arg } : arg;
|
|
336
331
|
};
|
|
@@ -344,7 +339,7 @@ export class ASTInterpreter {
|
|
|
344
339
|
* @returns {function} The binary division function.
|
|
345
340
|
*/
|
|
346
341
|
"binary%"(left, right, context) {
|
|
347
|
-
return
|
|
342
|
+
return (scope, locals, assign) => {
|
|
348
343
|
const arg = left(scope, locals, assign) % right(scope, locals, assign);
|
|
349
344
|
return context ? { value: arg } : arg;
|
|
350
345
|
};
|
|
@@ -358,7 +353,7 @@ export class ASTInterpreter {
|
|
|
358
353
|
* @returns {function} The binary strict equality function.
|
|
359
354
|
*/
|
|
360
355
|
"binary==="(left, right, context) {
|
|
361
|
-
return
|
|
356
|
+
return (scope, locals, assign) => {
|
|
362
357
|
const arg = left(scope, locals, assign) === right(scope, locals, assign);
|
|
363
358
|
return context ? { value: arg } : arg;
|
|
364
359
|
};
|
|
@@ -372,7 +367,7 @@ export class ASTInterpreter {
|
|
|
372
367
|
* @returns {function} The binary strict inequality function.
|
|
373
368
|
*/
|
|
374
369
|
"binary!=="(left, right, context) {
|
|
375
|
-
return
|
|
370
|
+
return (scope, locals, assign) => {
|
|
376
371
|
const arg = left(scope, locals, assign) !== right(scope, locals, assign);
|
|
377
372
|
return context ? { value: arg } : arg;
|
|
378
373
|
};
|
|
@@ -386,7 +381,7 @@ export class ASTInterpreter {
|
|
|
386
381
|
* @returns {function} The binary equality function.
|
|
387
382
|
*/
|
|
388
383
|
"binary=="(left, right, context) {
|
|
389
|
-
return
|
|
384
|
+
return (scope, locals, assign) => {
|
|
390
385
|
const arg = left(scope, locals, assign) == right(scope, locals, assign);
|
|
391
386
|
return context ? { value: arg } : arg;
|
|
392
387
|
};
|
|
@@ -400,7 +395,7 @@ export class ASTInterpreter {
|
|
|
400
395
|
* @returns {function} The binary inequality function.
|
|
401
396
|
*/
|
|
402
397
|
"binary!="(left, right, context) {
|
|
403
|
-
return
|
|
398
|
+
return (scope, locals, assign) => {
|
|
404
399
|
const arg = left(scope, locals, assign) != right(scope, locals, assign);
|
|
405
400
|
return context ? { value: arg } : arg;
|
|
406
401
|
};
|
|
@@ -414,7 +409,7 @@ export class ASTInterpreter {
|
|
|
414
409
|
* @returns {function} The binary less-than function.
|
|
415
410
|
*/
|
|
416
411
|
"binary<"(left, right, context) {
|
|
417
|
-
return
|
|
412
|
+
return (scope, locals, assign) => {
|
|
418
413
|
const arg = left(scope, locals, assign) < right(scope, locals, assign);
|
|
419
414
|
return context ? { value: arg } : arg;
|
|
420
415
|
};
|
|
@@ -428,7 +423,7 @@ export class ASTInterpreter {
|
|
|
428
423
|
* @returns {function} The binary greater-than function.
|
|
429
424
|
*/
|
|
430
425
|
"binary>"(left, right, context) {
|
|
431
|
-
return
|
|
426
|
+
return (scope, locals, assign) => {
|
|
432
427
|
const arg = left(scope, locals, assign) > right(scope, locals, assign);
|
|
433
428
|
return context ? { value: arg } : arg;
|
|
434
429
|
};
|
|
@@ -442,7 +437,7 @@ export class ASTInterpreter {
|
|
|
442
437
|
* @returns {function} The binary less-than-or-equal-to function.
|
|
443
438
|
*/
|
|
444
439
|
"binary<="(left, right, context) {
|
|
445
|
-
return
|
|
440
|
+
return (scope, locals, assign) => {
|
|
446
441
|
const arg = left(scope, locals, assign) <= right(scope, locals, assign);
|
|
447
442
|
return context ? { value: arg } : arg;
|
|
448
443
|
};
|
|
@@ -456,7 +451,7 @@ export class ASTInterpreter {
|
|
|
456
451
|
* @returns {function} The binary greater-than-or-equal-to function.
|
|
457
452
|
*/
|
|
458
453
|
"binary>="(left, right, context) {
|
|
459
|
-
return
|
|
454
|
+
return (scope, locals, assign) => {
|
|
460
455
|
const arg = left(scope, locals, assign) >= right(scope, locals, assign);
|
|
461
456
|
return context ? { value: arg } : arg;
|
|
462
457
|
};
|
|
@@ -483,7 +478,7 @@ export class ASTInterpreter {
|
|
|
483
478
|
* @returns {function} The binary logical OR function.
|
|
484
479
|
*/
|
|
485
480
|
"binary||"(left, right, context) {
|
|
486
|
-
return
|
|
481
|
+
return (scope, locals, assign) => {
|
|
487
482
|
const arg = left(scope, locals, assign) || right(scope, locals, assign);
|
|
488
483
|
return context ? { value: arg } : arg;
|
|
489
484
|
};
|
|
@@ -498,7 +493,7 @@ export class ASTInterpreter {
|
|
|
498
493
|
* @returns {function} The ternary conditional function.
|
|
499
494
|
*/
|
|
500
495
|
"ternary?:"(test, alternate, consequent, context) {
|
|
501
|
-
return
|
|
496
|
+
return (scope, locals, assign) => {
|
|
502
497
|
const arg = test(scope, locals, assign)
|
|
503
498
|
? alternate(scope, locals, assign)
|
|
504
499
|
: consequent(scope, locals, assign);
|
|
@@ -513,9 +508,8 @@ export class ASTInterpreter {
|
|
|
513
508
|
* @returns {import("./interface.ts").CompiledExpressionFunction} The function returning the literal value.
|
|
514
509
|
*/
|
|
515
510
|
value(value, context) {
|
|
516
|
-
return
|
|
517
|
-
|
|
518
|
-
};
|
|
511
|
+
return () =>
|
|
512
|
+
context ? { context: undefined, name: undefined, value } : value;
|
|
519
513
|
}
|
|
520
514
|
|
|
521
515
|
/**
|
|
@@ -526,7 +520,7 @@ export class ASTInterpreter {
|
|
|
526
520
|
* @returns {import("./interface.ts").CompiledExpressionFunction} The function returning the identifier value.
|
|
527
521
|
*/
|
|
528
522
|
identifier(name, context, create) {
|
|
529
|
-
return
|
|
523
|
+
return (scope, locals) => {
|
|
530
524
|
const base = locals && name in locals ? locals : scope;
|
|
531
525
|
if (create && create !== 1 && base && base[name] == null) {
|
|
532
526
|
base[name] = {};
|
|
@@ -551,7 +545,7 @@ export class ASTInterpreter {
|
|
|
551
545
|
* @returns {function} The function returning the computed member value.
|
|
552
546
|
*/
|
|
553
547
|
computedMember(left, right, context, create) {
|
|
554
|
-
return
|
|
548
|
+
return (scope, locals, assign) => {
|
|
555
549
|
const lhs = left(scope, locals, assign);
|
|
556
550
|
let rhs;
|
|
557
551
|
let value;
|
|
@@ -581,7 +575,7 @@ export class ASTInterpreter {
|
|
|
581
575
|
* @returns {function} The function returning the non-computed member value.
|
|
582
576
|
*/
|
|
583
577
|
nonComputedMember(left, right, context, create) {
|
|
584
|
-
return
|
|
578
|
+
return (scope, locals, assign) => {
|
|
585
579
|
const lhs = left(scope, locals, assign);
|
|
586
580
|
if (create && create !== 1) {
|
|
587
581
|
if (lhs && lhs[right] == null) {
|