@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
|
@@ -22,4 +22,27 @@
|
|
|
22
22
|
margin-right: 2rem;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
#npm {
|
|
27
|
+
margin-top: 2rem;
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
|
|
31
|
+
.click-to-copy {
|
|
32
|
+
display: block;
|
|
33
|
+
float: right;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
pre {
|
|
37
|
+
color: white;
|
|
38
|
+
background-color: gray !important;
|
|
39
|
+
border-radius: 5px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
code > :first-child {
|
|
43
|
+
padding: 1rem;
|
|
44
|
+
border-radius: 5px;
|
|
45
|
+
padding-right: 3rem;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
25
48
|
}
|
package/docs/content/_index.md
CHANGED
|
@@ -11,17 +11,18 @@ title: AngularTS
|
|
|
11
11
|
<p class="lead mb-5">A modern, reactive and typesafe evolution of the classic JS framework from Google©</p>
|
|
12
12
|
|
|
13
13
|
<div id="download">
|
|
14
|
-
<span id="version"
|
|
14
|
+
<span id="version"> {{< version >}} </span>
|
|
15
15
|
<a class="btn btn-lg btn-secondary me-3 mb-4" href="https://github.com/Angular-Wave/angular.ts">
|
|
16
16
|
Download <i class="fab fa-github ms-2 "></i>
|
|
17
17
|
</a>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div id="npm">
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm i @angular-wave/angular.ts
|
|
24
|
+
```
|
|
25
|
+
|
|
25
26
|
</div>
|
|
26
27
|
|
|
27
28
|
{{< /blocks/cover >}}
|
|
@@ -47,7 +47,7 @@ This code demonstrates the following key AngularTS features:
|
|
|
47
47
|
|
|
48
48
|
- **Island-first and zero-cost:** AngularTS creates an application on any HTML
|
|
49
49
|
tag with `ng-app` attribute, allowing multiple independent applications
|
|
50
|
-
(modules) to live on a single page.
|
|
50
|
+
(modules) to live on a single page. This allows AngularTS to work alongside
|
|
51
51
|
your existing tech stack where the majority of your page is rendered on the
|
|
52
52
|
server, while AngularTS is isolated to small “islands” (regions of your page)
|
|
53
53
|
where custom interactivity or personalization is required.
|
|
@@ -8,4 +8,4 @@ description: >
|
|
|
8
8
|
|
|
9
9
|
Use this directive to auto-bootstrap an AngularTS application. The `ng-app`
|
|
10
10
|
directive designates the root element of the application and is typically placed
|
|
11
|
-
near the root element of the page - e.g. on the
|
|
11
|
+
near the root element of the page - e.g. on the `<body>` or `<html>` tags.
|
|
@@ -20,13 +20,13 @@ user while the page is loading.
|
|
|
20
20
|
|
|
21
21
|
An alternative solution to this problem would be using the `ng-cloak` directive.
|
|
22
22
|
|
|
23
|
-
`ng-bind` can be modified with a `data-lazy` data attribute
|
|
24
|
-
update of element content until model is changed.
|
|
25
|
-
server-generated content, while keeping the UI
|
|
26
|
-
this technieque is known as
|
|
23
|
+
`ng-bind` can be modified with a `data-lazy` data attribute (or shorthand `lazy`
|
|
24
|
+
attribute), which will delay update of element content until model is changed.
|
|
25
|
+
This is useful for rendering server-generated content, while keeping the UI
|
|
26
|
+
dynamic. In other frameworks, this technieque is known as
|
|
27
27
|
[hydration](<https://en.wikipedia.org/wiki/Hydration_(web_development)>).
|
|
28
28
|
|
|
29
|
-
###
|
|
29
|
+
### Parameters
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
@@ -51,17 +51,19 @@ this technieque is known as
|
|
|
51
51
|
|
|
52
52
|
#### `data-lazy`
|
|
53
53
|
|
|
54
|
-
- **Type:**
|
|
54
|
+
- **Type:** N/A
|
|
55
55
|
- **Description:** Apply expression once the bound model changes.
|
|
56
56
|
- **Example:**
|
|
57
57
|
|
|
58
58
|
```html
|
|
59
|
-
<div ng-bind="name" data-lazy
|
|
59
|
+
<div ng-bind="name" data-lazy></div>
|
|
60
|
+
<!-- or -->
|
|
61
|
+
<div ng-bind="name" lazy></div>
|
|
60
62
|
```
|
|
61
63
|
|
|
62
64
|
---
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
### Demo
|
|
65
67
|
|
|
66
68
|
{{< showhtml src="examples/ng-bind/ng-bind.html" >}}
|
|
67
69
|
|
|
@@ -13,8 +13,8 @@ using `$eventBus`.
|
|
|
13
13
|
directive will **replace the element's inner HTML** with the published value.
|
|
14
14
|
- If the element **does** contain a template and the published value is an
|
|
15
15
|
**object**, the directive will **merge the object’s key-value pairs into the
|
|
16
|
-
current scope**, allowing Angular expressions like
|
|
17
|
-
|
|
16
|
+
current scope**, allowing Angular expressions like to be evaluated and
|
|
17
|
+
rendered.
|
|
18
18
|
|
|
19
19
|
The directive automatically unsubscribes from the event channel when the scope
|
|
20
20
|
is destroyed.
|
|
@@ -21,7 +21,7 @@ to the element:
|
|
|
21
21
|
| [`add-class`](../../service/animate) | Before the class is applied to the element |
|
|
22
22
|
| [`remove-class`](../../service/animate) | Before the class is removed from the element |
|
|
23
23
|
|
|
24
|
-
###
|
|
24
|
+
### Parameters
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
@@ -22,7 +22,7 @@ to the element:
|
|
|
22
22
|
| [`add-class`](../../service/animate) | Before the class is applied to the element |
|
|
23
23
|
| [`remove-class`](../../service/animate) | Before the class is removed from the element |
|
|
24
24
|
|
|
25
|
-
###
|
|
25
|
+
### Parameters
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-get
|
|
3
|
+
description: >
|
|
4
|
+
Initiates a GET request
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-get` directive allows you to fetch content via `$http` service from a
|
|
10
|
+
remote URL and insert, replace, or manipulate it into the DOM. In case of server
|
|
11
|
+
error, the directive displays the error in place of success result. This
|
|
12
|
+
behavior can be modified with error parameters below.
|
|
13
|
+
|
|
14
|
+
### Parameters
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
#### `ng-get`
|
|
19
|
+
|
|
20
|
+
- **Type:** `string`
|
|
21
|
+
- **Description:** A URL to issue a GET request to
|
|
22
|
+
- **Example:**
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<div ng-get="/example">get</div>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### Modifiers
|
|
31
|
+
|
|
32
|
+
#### `data-trigger`
|
|
33
|
+
|
|
34
|
+
- **Type:** `string`
|
|
35
|
+
- **Description:** Specifies the DOM event for triggering a request (default is
|
|
36
|
+
`click`). For a complete list, see
|
|
37
|
+
[UI Events](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events)
|
|
38
|
+
- **Example:**
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<div ng-get="/example" trigger="mouseover">Get</div>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
#### `data-latch`
|
|
47
|
+
|
|
48
|
+
- **Type:** `string`
|
|
49
|
+
- **Description:** Triggers a request whenever its value changes. Can Cn be used
|
|
50
|
+
with interpolation (e.g., {{ expression }}) to observe reactive changes in the
|
|
51
|
+
scope.
|
|
52
|
+
- **Example:**
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<div ng-get="/example" latch="{{ latch }}" ng-mouseover="latch = !latch">
|
|
56
|
+
Get
|
|
57
|
+
</div>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
#### `data-swap`
|
|
63
|
+
|
|
64
|
+
- **Type:** [SwapMode](../../../typedoc/variables/SwapMode.html)
|
|
65
|
+
- **Description:** Controls how the response is inserted
|
|
66
|
+
- **Example:**
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<div ng-get="/example" swap="outerHTML">Get</div>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
#### `data-target`
|
|
75
|
+
|
|
76
|
+
- **Type:**
|
|
77
|
+
[selectors](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector#selectors)
|
|
78
|
+
- **Description:** Specifies a DOM element where the response should be rendered
|
|
79
|
+
- **Example:**
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<div ng-get="/example" target=".test">Get</div>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
#### `data-delay`
|
|
88
|
+
|
|
89
|
+
- **Type:**
|
|
90
|
+
[delay](https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout#delay)
|
|
91
|
+
- **Description:** Delay request by N millisecond
|
|
92
|
+
- **Example:**
|
|
93
|
+
|
|
94
|
+
```html
|
|
95
|
+
<div ng-get="/example" delay="1000">Get</div>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
#### `data-interval`
|
|
101
|
+
|
|
102
|
+
- **Type:**
|
|
103
|
+
[delay](https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval#delay)
|
|
104
|
+
- **Description:** Repeat request every N milliseconds
|
|
105
|
+
- **Example:**
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<div ng-get="/example" interval="1000">Get</div>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
#### `data-throttle`
|
|
114
|
+
|
|
115
|
+
- **Type:**
|
|
116
|
+
[delay](https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout#delay)
|
|
117
|
+
- **Description:** Ignores subsequent requests for N milliseconds
|
|
118
|
+
- **Example:**
|
|
119
|
+
|
|
120
|
+
```html
|
|
121
|
+
<div ng-get="/example" throttle="1000">Get</div>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
#### `data-loading`
|
|
127
|
+
|
|
128
|
+
- **Type:** N/A
|
|
129
|
+
- **Description:** Adds a data-loading="true/false" flag during request
|
|
130
|
+
lifecycle.
|
|
131
|
+
- **Example:**
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<div ng-get="/example" data-loading>Get</div>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
#### `data-loading-class`
|
|
140
|
+
|
|
141
|
+
- **Type:** `string`
|
|
142
|
+
- **Description:** Toggles the specified class on the element while loading.
|
|
143
|
+
- **Example:**
|
|
144
|
+
|
|
145
|
+
```html
|
|
146
|
+
<div ng-get="/example" data-loading-class="red">Get</div>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
#### `data-success`
|
|
152
|
+
|
|
153
|
+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
|
|
154
|
+
- **Description:** Evaluates expression when request succeeds. Response data is
|
|
155
|
+
available as a `$res` property on the scope.
|
|
156
|
+
- **Example:**
|
|
157
|
+
|
|
158
|
+
```html
|
|
159
|
+
<div ng-get="/example" success="message = $res">Get {{ message }}</div>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
#### `data-error`
|
|
165
|
+
|
|
166
|
+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
|
|
167
|
+
- **Description:** Evaluates expression when request fails. Response data is
|
|
168
|
+
available as a `$res` property on the scope.
|
|
169
|
+
- **Example:**
|
|
170
|
+
|
|
171
|
+
```html
|
|
172
|
+
<div ng-get="/example" error="errormessage = $res">
|
|
173
|
+
Get {{ errormessage }}
|
|
174
|
+
</div>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
#### `data-success-state`
|
|
180
|
+
|
|
181
|
+
- **Type:** `string`
|
|
182
|
+
- **Description:** Name of the state to nagitate to when request succeeds
|
|
183
|
+
- **Example:**
|
|
184
|
+
|
|
185
|
+
```html
|
|
186
|
+
<ng-view></ng-view>
|
|
187
|
+
<div ng-get="/example" success-state="account">Get</div>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
#### `data-success-error`
|
|
193
|
+
|
|
194
|
+
- **Type:** `string`
|
|
195
|
+
- **Description:** Name of the state to nagitate to when request fails
|
|
196
|
+
- **Example:**
|
|
197
|
+
|
|
198
|
+
```html
|
|
199
|
+
<ng-view></ng-view>
|
|
200
|
+
<div ng-get="/example" error-state="login">Get</div>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-non-bindable
|
|
3
|
+
description: >
|
|
4
|
+
Stops compilation for element
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-non-bindable` directive tells the framework not to compile or bind the
|
|
10
|
+
contents of the current DOM element, including directives on the element itself
|
|
11
|
+
that have a lower priority than `ngNonBindable`. This is useful if the element
|
|
12
|
+
contains what appears to be directives and bindings but which should be ignored.
|
|
13
|
+
This could be the case if you have a site that displays snippets of code, for
|
|
14
|
+
instance.
|
|
15
|
+
|
|
16
|
+
#### `ng-non-bindable`
|
|
17
|
+
|
|
18
|
+
- **Type:** N/A
|
|
19
|
+
- **Description:** Stops compilation process for element
|
|
20
|
+
- **Priority:** 1000
|
|
21
|
+
- **Element:** ANY
|
|
22
|
+
- **Example:**
|
|
23
|
+
|
|
24
|
+
{{< showhtml src="examples/ng-non-bindable/ng-non-bindable.html" >}}
|
|
25
|
+
|
|
26
|
+
***
|
|
27
|
+
|
|
28
|
+
{{< showraw src="examples/ng-non-bindable/ng-non-bindable.html" >}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: $locationProvider
|
|
3
|
+
description: >
|
|
4
|
+
Configuration provider for `$location` service.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
Use the `$locationProvider` to configure how the application deep linking paths
|
|
10
|
+
are stored.
|
|
11
|
+
|
|
12
|
+
### Properties
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
#### $locationProvider.html5ModeConf
|
|
17
|
+
|
|
18
|
+
- **Type:** Html5Mode
|
|
19
|
+
- **Default:** `{ enabled: true, requireBase: false, rewriteLinks: true }`
|
|
20
|
+
- **Example:**
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
angular.module('demo', []).config(($locationProvider) => {
|
|
24
|
+
$locationProvider.html5ModeConf.enabled = false;
|
|
25
|
+
});
|
|
26
|
+
```
|
|
@@ -6,10 +6,75 @@ description: >
|
|
|
6
6
|
|
|
7
7
|
### Description
|
|
8
8
|
|
|
9
|
-
Initializes cache
|
|
9
|
+
Initializes cache instance for `$templateCache` service as an empty
|
|
10
10
|
[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
|
|
11
11
|
object.
|
|
12
12
|
|
|
13
|
+
An alternative caching implementation can be provided by implementing
|
|
14
|
+
[TemplateCache](../../../typedoc/types/TemplateCache.html) interface for web
|
|
15
|
+
standard storage options like `localStorage`, `sessionStorage`, `IndexedDB`, or
|
|
16
|
+
`Cache API`. You can also use third-party storage engines like
|
|
17
|
+
[pouch](https://github.com/pouchdb/pouchdb) or
|
|
18
|
+
[SQLite](https://sqlite.org/wasm/doc/trunk/index.md). With WebAssembly (WASM),
|
|
19
|
+
even more powerful and flexible storage backends become possible.
|
|
20
|
+
|
|
21
|
+
Below is an example implementation using `localStorage`:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
class LocalStorageMap {
|
|
25
|
+
constructor(prefix = '') {
|
|
26
|
+
this.prefix = prefix;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_key(key) {
|
|
30
|
+
return `${this.prefix}${key}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get(key) {
|
|
34
|
+
const raw = localStorage.getItem(this._key(key));
|
|
35
|
+
if (raw === null) return undefined;
|
|
36
|
+
try {
|
|
37
|
+
return JSON.parse(raw);
|
|
38
|
+
} catch {
|
|
39
|
+
return raw;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set(key, value) {
|
|
44
|
+
localStorage.setItem(this._key(key), value);
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
has(key) {
|
|
49
|
+
return localStorage.getItem(this._key(key)) !== null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
delete(key) {
|
|
53
|
+
localStorage.removeItem(this._key(key));
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
clear() {
|
|
58
|
+
const toRemove = [];
|
|
59
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
60
|
+
const k = localStorage.key(i);
|
|
61
|
+
if (k && k.startsWith(this.prefix)) {
|
|
62
|
+
toRemove.push(k);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
toRemove.forEach((k) => localStorage.removeItem(k));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Override during configuration phase:
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
angular.module('demo', []).config(($templateCacheProvider) => {
|
|
74
|
+
templateCacheProvider.cache = new LocalStorageMap();
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
13
78
|
### Properties
|
|
14
79
|
|
|
15
80
|
---
|