@angular-wave/angular.ts 0.7.3 → 0.7.5
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/.prettierignore +2 -1
- package/@types/core/exception-handler.d.ts +2 -2
- package/@types/core/task-tracker-factory.d.ts +2 -2
- package/@types/directive/channel/channel.d.ts +2 -18
- package/@types/directive/http/http.d.ts +3 -0
- package/@types/directive/script/script.d.ts +2 -2
- package/@types/directive/setter/setter.d.ts +2 -2
- package/@types/injection-tokens.d.ts +3 -0
- package/@types/interface.d.ts +11 -0
- package/@types/loader.d.ts +3 -4
- package/@types/router/params/param-factory.d.ts +10 -2
- package/@types/router/params/param.d.ts +22 -3
- package/@types/router/template-factory.d.ts +2 -2
- package/@types/router/url/url-service.d.ts +2 -2
- package/@types/services/http/http.d.ts +2 -2
- package/@types/services/http/interface.d.ts +219 -0
- package/@types/services/http-backend/http-backend.d.ts +26 -19
- package/@types/services/log/interface.d.ts +33 -0
- package/@types/services/log/log.d.ts +25 -0
- package/@types/{core → services}/pubsub/pubsub.d.ts +6 -6
- package/@types/services/template-cache/interface.d.ts +4 -0
- package/@types/services/template-cache/template-cache.d.ts +11 -0
- package/@types/services/template-request.d.ts +1 -1
- package/@types/shared/cache.d.ts +9 -0
- package/@types/shared/dom.d.ts +2 -2
- package/Makefile +2 -2
- package/dist/angular-ts.esm.js +168 -165
- package/dist/angular-ts.umd.js +168 -165
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/assets/scss/_variables_project.scss +1 -1
- package/docs/assets/scss/_variables_project_after_bs.scss +5 -5
- package/docs/assets/scss/index.scss +2 -3
- package/docs/content/_index.md +1 -1
- package/docs/content/docs/_index.md +59 -25
- package/docs/content/docs/directive/_index.md +4 -0
- package/docs/content/docs/directive/app.md +11 -0
- package/docs/content/docs/directive/aria.md +0 -0
- package/docs/content/docs/directive/blur.md +38 -0
- package/docs/content/docs/directive/channel.md +37 -0
- package/docs/content/docs/directive/class-even.md +47 -0
- package/docs/content/docs/directive/class-odd.md +48 -0
- package/docs/content/docs/directive/class.md +64 -0
- package/docs/content/docs/directive/click.md +38 -0
- package/docs/content/docs/directive/cloak.md +74 -0
- package/docs/content/docs/directive/copy.md +38 -0
- package/docs/content/docs/directive/cut.md +40 -0
- package/docs/content/docs/directive/dblclick.md +38 -0
- package/docs/content/docs/directive/focus.md +38 -0
- package/docs/content/docs/directive/include.md +7 -0
- package/docs/content/docs/directive/keydown.md +0 -0
- package/docs/content/docs/directive/keyup.md +0 -0
- package/docs/content/docs/directive/load.md +0 -0
- package/docs/content/docs/directive/mousedown.md +38 -0
- package/docs/content/docs/directive/mouseenter.md +38 -0
- package/docs/content/docs/directive/mouseleave.md +38 -0
- package/docs/content/docs/directive/mousemove.md +38 -0
- package/docs/content/docs/directive/mouseout.md +38 -0
- package/docs/content/docs/directive/mouseover.md +38 -0
- package/docs/content/docs/directive/mouseup.md +38 -0
- package/docs/content/docs/filter/_index.md +4 -0
- package/docs/content/docs/provider/_index.md +4 -0
- package/docs/content/docs/provider/eventBusProvider.md +35 -0
- package/docs/content/docs/provider/logProvider.md +59 -0
- package/docs/content/docs/provider/templateCacheProvider.md +35 -0
- package/docs/content/docs/service/_index.md +4 -0
- package/docs/content/docs/service/eventBus.md +56 -0
- package/docs/content/docs/service/log.md +113 -0
- package/docs/content/docs/service/templateCache.md +64 -0
- package/docs/hugo.yaml +3 -3
- package/docs/layouts/404.html +1 -1
- package/docs/layouts/partials/hooks/head-end.html +3 -0
- package/docs/layouts/shortcodes/showhtml.html +2 -0
- package/docs/layouts/shortcodes/showjs.html +2 -0
- package/docs/layouts/shortcodes/showraw.html +1 -0
- package/docs/static/examples/counter/counter-test.html +17 -0
- package/docs/static/examples/counter/counter.html +5 -0
- package/docs/static/examples/counter/counter.test.js +28 -0
- package/docs/static/examples/eventbus/eventbus-test.html +19 -0
- package/docs/static/examples/eventbus/eventbus.html +13 -0
- package/docs/static/examples/eventbus/eventbus.js +15 -0
- package/docs/static/examples/eventbus/eventbus.test.js +19 -0
- package/docs/static/examples/ng-blur/ng-blur.html +9 -0
- package/docs/static/examples/ng-channel/ng-channel-test.html +17 -0
- package/docs/static/examples/ng-channel/ng-channel.html +24 -0
- package/docs/static/examples/ng-channel/ng-channel.test.js +31 -0
- package/docs/static/examples/ng-class/ng-class.html +71 -0
- package/docs/static/examples/ng-class-even/ng-class-even.html +8 -0
- package/docs/static/examples/ng-class-odd/ng-class-odd.html +8 -0
- package/docs/static/examples/ng-click/ng-click.html +6 -0
- package/docs/static/examples/ng-copy/ng-copy.html +6 -0
- package/docs/static/examples/ng-cut/ng-cut.html +6 -0
- package/docs/static/examples/ng-dblclick/ng-dblclick.html +10 -0
- package/docs/static/examples/ng-focus/ng-focus.html +9 -0
- package/docs/static/examples/ng-mousedown/ng-mousedown.html +6 -0
- package/docs/static/examples/ng-mouseenter/ng-mouseenter.html +4 -0
- package/docs/static/examples/ng-mouseleave/ng-mouseleave.html +4 -0
- package/docs/static/examples/ng-mousemove/ng-mousemove.html +4 -0
- package/docs/static/examples/ng-mouseout/ng-mouseout.html +4 -0
- package/docs/static/examples/ng-mouseover/ng-mouseover.html +4 -0
- package/docs/static/examples/ng-mouseup/ng-mouseup.html +4 -0
- package/docs/static/typedoc/assets/hierarchy.js +1 -1
- package/docs/static/typedoc/assets/navigation.js +1 -1
- package/docs/static/typedoc/assets/search.js +1 -1
- package/docs/static/typedoc/classes/LogProvider.html +6 -0
- package/docs/static/typedoc/classes/PubSub.html +71 -0
- package/docs/static/typedoc/classes/PubSubProvider.html +3 -0
- package/docs/static/typedoc/classes/TemplateCacheProvider.html +5 -0
- package/docs/static/typedoc/hierarchy.html +1 -1
- package/docs/static/typedoc/index.html +1 -1
- package/docs/static/typedoc/interfaces/ChangesObject.html +1 -1
- package/docs/static/typedoc/interfaces/ComponentOptions.html +1 -1
- package/docs/static/typedoc/interfaces/Controller.html +1 -1
- package/docs/static/typedoc/interfaces/Directive.html +1 -1
- package/docs/static/typedoc/interfaces/DirectivePrePost.html +1 -1
- package/docs/static/typedoc/interfaces/HttpHeadersGetter.html +1 -0
- package/docs/static/typedoc/interfaces/HttpProviderDefaults.html +31 -0
- package/docs/static/typedoc/interfaces/HttpRequestConfigHeaders.html +6 -0
- package/docs/static/typedoc/interfaces/HttpRequestTransformer.html +1 -0
- package/docs/static/typedoc/interfaces/HttpResponse.html +8 -0
- package/docs/static/typedoc/interfaces/HttpResponseTransformer.html +1 -0
- package/docs/static/typedoc/interfaces/HttpService.html +38 -0
- package/docs/static/typedoc/interfaces/LogService.html +12 -0
- package/docs/static/typedoc/interfaces/NgModelController.html +1 -1
- package/docs/static/typedoc/interfaces/NgModelOptions.html +1 -1
- package/docs/static/typedoc/interfaces/Provider.html +1 -1
- package/docs/static/typedoc/interfaces/RequestConfig.html +48 -0
- package/docs/static/typedoc/interfaces/RequestShortcutConfig.html +38 -0
- package/docs/static/typedoc/interfaces/ServiceProvider.html +1 -1
- package/docs/static/typedoc/interfaces/TranscludeFunctionObject.html +1 -1
- package/docs/static/typedoc/types/AnnotatedFactory.html +1 -1
- package/docs/static/typedoc/types/CloneAttachFunction.html +1 -1
- package/docs/static/typedoc/types/ControllerConstructor.html +1 -1
- package/docs/static/typedoc/types/DirectiveCompileFn.html +1 -1
- package/docs/static/typedoc/types/DirectiveController.html +1 -1
- package/docs/static/typedoc/types/DirectiveFactory.html +1 -1
- package/docs/static/typedoc/types/DirectiveLinkFn.html +1 -1
- package/docs/static/typedoc/types/ExpandoStore.html +2 -0
- package/docs/static/typedoc/types/Expression.html +1 -1
- package/docs/static/typedoc/types/FilterFactory.html +1 -1
- package/docs/static/typedoc/types/FilterFn.html +1 -1
- package/docs/static/typedoc/types/HttpPromise.html +1 -0
- package/docs/static/typedoc/types/Injectable.html +1 -1
- package/docs/static/typedoc/types/InjectableFactory.html +1 -1
- package/docs/static/typedoc/types/LogCall.html +2 -0
- package/docs/static/typedoc/types/LogServiceFactory.html +2 -0
- package/docs/static/typedoc/types/OnChangesObject.html +1 -1
- package/docs/static/typedoc/types/SwapInsertPosition.html +1 -1
- package/docs/static/typedoc/types/TController.html +1 -1
- package/docs/static/typedoc/types/TemplateCache.html +2 -0
- package/docs/static/typedoc/variables/EventBus.html +1 -0
- package/index.html +4 -2
- package/package.json +3 -3
- package/src/animations/animate-css.js +5 -1
- package/src/binding.spec.js +3 -1
- package/src/core/compile/compile.spec.js +12 -5
- package/src/core/core.html +0 -1
- package/src/core/exception-handler.js +1 -1
- package/src/core/prop.spec.js +1 -0
- package/src/core/task-tracker-factory.js +2 -2
- package/src/directive/bind/bind.spec.js +1 -4
- package/src/directive/channel/channel.js +8 -24
- package/src/directive/channel/channel.spec.js +4 -2
- package/src/directive/class/class.js +16 -0
- package/src/directive/class/class.spec.js +2 -0
- package/src/directive/events/event.spec.js +1 -0
- package/src/directive/events/events.js +21 -24
- package/src/directive/form/form.spec.js +2 -0
- package/src/directive/http/http.js +4 -4
- package/src/directive/if/if.spec.js +2 -0
- package/src/directive/include/include.spec.js +1 -0
- package/src/directive/input/input.spec.js +1 -0
- package/src/directive/model/model.spec.js +3 -0
- package/src/directive/model-options/model-options.spec.js +2 -0
- package/src/directive/observe/{test.html → observe-demo.html} +0 -1
- package/src/directive/observe/observe.spec.js +2 -1
- package/src/{core/pubsub/pubsub.html → directive/on/on.html} +1 -1
- package/src/{core → directive/on}/on.spec.js +5 -3
- package/src/directive/on/on.test.js +11 -0
- package/src/directive/options/options.spec.js +1 -0
- package/src/directive/script/script.js +1 -1
- package/src/directive/select/select.spec.js +1 -0
- package/src/directive/setter/setter.js +1 -1
- package/src/directive/setter/setter.spec.js +2 -0
- package/src/directive/switch/switch.spec.js +1 -0
- package/src/injection-tokens.js +3 -0
- package/src/interface.ts +10 -0
- package/src/loader.js +3 -6
- package/src/public.js +3 -3
- package/src/router/directives/state-directives.spec.js +3 -1
- package/src/router/params/param-factory.js +6 -0
- package/src/router/params/param.js +22 -7
- package/src/router/router.html +0 -1
- package/src/router/router.test.js +2 -1
- package/src/router/services.spec.js +2 -0
- package/src/router/state/state-builder.js +3 -0
- package/src/router/state/state-builder.spec.js +2 -0
- package/src/router/state/state-service.js +1 -1
- package/src/router/state-filter.spec.js +2 -0
- package/src/router/template-factory.html +19 -0
- package/src/router/template-factory.js +3 -3
- package/src/router/template-factory.spec.js +1 -0
- package/src/router/template-factory.test.js +12 -0
- package/src/router/transition/transition-hook.js +1 -1
- package/src/router/url/url-service.js +1 -1
- package/src/router/view-scroll.spec.js +3 -1
- package/src/services/http/http.js +4 -4
- package/src/services/http/http.test.js +1 -1
- package/src/services/http/interface.ts +243 -0
- package/src/services/http-backend/http-backend.js +21 -11
- package/src/services/log/interface.ts +39 -0
- package/src/services/log/log.html +19 -0
- package/src/services/log/log.js +74 -0
- package/src/services/log/log.spec.js +64 -0
- package/src/services/log/log.test.js +11 -0
- package/src/services/pubsub/pubsub.html +19 -0
- package/src/{core → services}/pubsub/pubsub.js +6 -5
- package/src/{core → services}/pubsub/pubsub.spec.js +3 -3
- package/src/{core → services}/pubsub/pubsub.test.js +1 -1
- package/src/services/template-cache/interface.ts +4 -0
- package/src/services/template-cache/template-cache.html +22 -0
- package/src/services/template-cache/template-cache.js +13 -0
- package/src/services/template-cache/template-cache.spec.js +62 -0
- package/src/services/template-cache/template-cache.test.js +11 -0
- package/src/services/template-request.js +2 -2
- package/src/shared/cache.js +9 -0
- package/src/shared/dom.js +13 -7
- package/utils/express.js +7 -9
- package/@types/core/cache/cache-factory.d.ts +0 -22
- package/@types/core/cache/cache.d.ts +0 -28
- package/@types/services/log.d.ts +0 -53
- package/src/core/cache/cache-factory.js +0 -19
- package/src/core/cache/cache.js +0 -27
- package/src/directive/class/class.md +0 -90
- package/src/directive/cloak/cloak.md +0 -24
- package/src/examples/counter.html +0 -20
- package/src/services/log.js +0 -95
- package/src/services/log.md +0 -39
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
body {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
font-family: 'Inter', sans-serif !important;
|
|
3
|
+
& .navbar-brand__name {
|
|
4
|
+
margin-left: -5px;
|
|
5
|
+
}
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
@import
|
|
8
|
+
@import 'index.scss';
|
package/docs/content/_index.md
CHANGED
|
@@ -6,7 +6,7 @@ title: AngularTS
|
|
|
6
6
|
|
|
7
7
|
<div class="text-center">
|
|
8
8
|
<h1 class="display-1 mt-0 mt-md-5 pb-4">Angular<span>TS</span></h1>
|
|
9
|
-
</div>
|
|
9
|
+
</div>
|
|
10
10
|
|
|
11
11
|
<p class="lead mb-5">A modern, reactive and typesafe evolution of the classic JS framework from Google©</p>
|
|
12
12
|
<a class="btn btn-lg btn-secondary me-3 mb-4" href="https://github.com/Angular-Wave/angular.ts">
|
|
@@ -1,27 +1,61 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
2
|
title: Documentation
|
|
3
3
|
linkTitle: Docs
|
|
4
|
-
menu: {main: {weight: 20}}
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
4
|
+
menu: { main: { weight: 20 } }
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Welcome to AngularTS documentation.
|
|
8
|
+
|
|
9
|
+
This section is a work in progress. Its content will be updated regularly but
|
|
10
|
+
feel free to rely on [AngularJS](https://docs.angularjs.org/guide) documentation
|
|
11
|
+
in the meantime.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
### What is AngularTS?
|
|
16
|
+
|
|
17
|
+
AngularTS is buildless, type-safe and reactive JS framework for building
|
|
18
|
+
stuctured web applications at any scale. It continues the legacy of
|
|
19
|
+
[AngularJS](https://angularjs.org/) by providing the best developer experience
|
|
20
|
+
via immediate productivity without the burden of JS ecosystem tooling. Getting
|
|
21
|
+
started with AngularTS does not even require JavaScript. All you need is a
|
|
22
|
+
little bit of HTML. Below is a canonical example of a counter:
|
|
23
|
+
|
|
24
|
+
#### Example
|
|
25
|
+
|
|
26
|
+
{{< showhtml src="examples/counter/counter.html" >}}
|
|
27
|
+
|
|
28
|
+
#### Result
|
|
29
|
+
|
|
30
|
+
{{< showraw src="examples/counter/counter.html" >}}
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
This code demonstrates the following key AngularTS features:
|
|
35
|
+
|
|
36
|
+
- **HTML-first:** AngularTS is designed for HTML-first approach, meaning your
|
|
37
|
+
application logic can be expressed declaratively in your markup using custom
|
|
38
|
+
attributes--called _directives_. Here, we are using `ng-init` directive to
|
|
39
|
+
initialize our application state and `ng-click` directive to add an event
|
|
40
|
+
handler that changes our state.
|
|
41
|
+
|
|
42
|
+
- **Template-driven:** AngularTS’s built-in template engine automatically keeps
|
|
43
|
+
the UI in sync with your application state, eliminating the need for manual
|
|
44
|
+
DOM tracking and updates. The `{{count}}` expression above is an example of
|
|
45
|
+
Angular's interpolation syntax. As the value of `count` variable increases,
|
|
46
|
+
our UI is updated with the new state.
|
|
47
|
+
|
|
48
|
+
- **Island-first and zero-cost:** AngularTS creates an application on any HTML
|
|
49
|
+
tag with `ng-app` attribute, allowing multiple independent applications
|
|
50
|
+
(modules) to live on a single page. The enables AngularTS to work alongside
|
|
51
|
+
your existing tech stack where the majority of your page is rendered on the
|
|
52
|
+
server, while AngularTS is isolated to small “islands” (regions of your page)
|
|
53
|
+
where custom interactivity or personalization is required.
|
|
54
|
+
|
|
55
|
+
- **Micro-framework appearance:** With its minimal setup, AngularTS is
|
|
56
|
+
well-suited for quick experiments, LLM-generated code, and learning web
|
|
57
|
+
development in general. But beneath its lightweight surface, it supports
|
|
58
|
+
structured enterprise design patterns, MVC architecture, and component-driven
|
|
59
|
+
design. With its rich directive library, state-based routing and support for
|
|
60
|
+
animations, AngularTS is a complete package for building large SPAs, server,
|
|
61
|
+
mobile, and desktop applications.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-app
|
|
3
|
+
description: >
|
|
4
|
+
Bootstrap AngularTS application
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
Use this directive to auto-bootstrap an AngularTS application. The `ng-app`
|
|
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 <body> or <html> tags.
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-blur
|
|
3
|
+
description: >
|
|
4
|
+
Handler for blur event
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-blur` directive allows you to specify custom behavior when an element
|
|
10
|
+
loses focus.
|
|
11
|
+
|
|
12
|
+
### Directive parameters
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
#### `ng-blur`
|
|
17
|
+
|
|
18
|
+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
|
|
19
|
+
- **Description:** Expression to evaluate upon
|
|
20
|
+
[blur](https://developer.mozilla.org/en-US/docs/Web/API/Element/blur_event)
|
|
21
|
+
event.
|
|
22
|
+
[FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent)
|
|
23
|
+
object is available as `$event`.
|
|
24
|
+
- **Example:**
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<div ng-blur="$ctrl.handleBlur($event)"></div>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
#### Demo
|
|
33
|
+
|
|
34
|
+
{{< showhtml src="examples/ng-blur/ng-blur.html" >}}
|
|
35
|
+
|
|
36
|
+
{{< showraw src="examples/ng-blur/ng-blur.html" >}}
|
|
37
|
+
|
|
38
|
+
---
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-channel
|
|
3
|
+
description: >
|
|
4
|
+
Subscribe a template to a messaging service topic
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
Updates element’s content by subscribing to events published on a named channel
|
|
10
|
+
using `$eventBus`.
|
|
11
|
+
|
|
12
|
+
- If the element **does not** contain any child elements or templates, the
|
|
13
|
+
directive will **replace the element's inner HTML** with the published value.
|
|
14
|
+
- If the element **does** contain a template and the published value is an
|
|
15
|
+
**object**, the directive will **merge the object’s key-value pairs into the
|
|
16
|
+
current scope**, allowing Angular expressions like `{{ user.firstName }}` to
|
|
17
|
+
be evaluated and rendered.
|
|
18
|
+
|
|
19
|
+
The directive automatically unsubscribes from the event channel when the scope
|
|
20
|
+
is destroyed.
|
|
21
|
+
|
|
22
|
+
### Parameters
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
#### `ng-channel`
|
|
27
|
+
|
|
28
|
+
- **Type:** `string`
|
|
29
|
+
- **Description:** The name of the channel to subscribe to using `$eventBus`.
|
|
30
|
+
|
|
31
|
+
### Demo
|
|
32
|
+
|
|
33
|
+
{{< showhtml src="examples/ng-channel/ng-channel.html" >}}
|
|
34
|
+
|
|
35
|
+
{{< showraw src="examples/ng-channel/ng-channel.html" >}}
|
|
36
|
+
|
|
37
|
+
---
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-class-even
|
|
3
|
+
description: >
|
|
4
|
+
Apply CSS classes to even-indexed elements inside `ng-repeat`.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-class-even` directive works just like [`ng-class`](./class), but it
|
|
10
|
+
applies only to **even-indexed** elements in an [`ng-repeat`](../repeat) block.
|
|
11
|
+
|
|
12
|
+
> Must be used inside `ng-repeat`.
|
|
13
|
+
|
|
14
|
+
### Animations
|
|
15
|
+
|
|
16
|
+
If `data-animate` attribute is present, the following animations will be applied
|
|
17
|
+
to the element:
|
|
18
|
+
|
|
19
|
+
| Animation | Occurs |
|
|
20
|
+
| --------------------------------------- | -------------------------------------------- |
|
|
21
|
+
| [`add-class`](../../service/animate) | Before the class is applied to the element |
|
|
22
|
+
| [`remove-class`](../../service/animate) | Before the class is removed from the element |
|
|
23
|
+
|
|
24
|
+
### Directive parameters
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
#### `ng-class-even`
|
|
29
|
+
|
|
30
|
+
- **Type:** `string | array`
|
|
31
|
+
- **Description:** An expression evaluating to a space-delimited string or array
|
|
32
|
+
of class names.
|
|
33
|
+
- **Example:**
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<div ng-repeat="item in items" ng-class-even="'even-row'"></div>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### Demo
|
|
42
|
+
|
|
43
|
+
{{< showhtml src="examples/ng-class-even/ng-class-even.html" >}}
|
|
44
|
+
|
|
45
|
+
{{< showraw src="examples/ng-class-even/ng-class-even.html" >}}
|
|
46
|
+
|
|
47
|
+
---
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-class-odd
|
|
3
|
+
description: >
|
|
4
|
+
Apply CSS classes to odd-indexed elements inside `ng-repeat`.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-class-odd` directive works just like [`ng-class`](../class), but it
|
|
10
|
+
applies only to **odd-indexed** elements inside an [`ng-repeat`](../repeat)
|
|
11
|
+
block.
|
|
12
|
+
|
|
13
|
+
> Must be used inside `ng-repeat`.
|
|
14
|
+
|
|
15
|
+
### Animations
|
|
16
|
+
|
|
17
|
+
If `data-animate` attribute is present, the following animations will be applied
|
|
18
|
+
to the element:
|
|
19
|
+
|
|
20
|
+
| Animation | Occurs |
|
|
21
|
+
| --------------------------------------- | -------------------------------------------- |
|
|
22
|
+
| [`add-class`](../../service/animate) | Before the class is applied to the element |
|
|
23
|
+
| [`remove-class`](../../service/animate) | Before the class is removed from the element |
|
|
24
|
+
|
|
25
|
+
### Directive parameters
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
#### `ng-class-odd`
|
|
30
|
+
|
|
31
|
+
- **Type:** `string | array`
|
|
32
|
+
- **Description:** An expression evaluating to a space-delimited string or array
|
|
33
|
+
of class names.
|
|
34
|
+
- **Example:**
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<div ng-repeat="item in items" ng-class-odd="'odd-row'"></div>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### Demo
|
|
43
|
+
|
|
44
|
+
{{< showhtml src="examples/ng-class-odd/ng-class-odd.html" >}}
|
|
45
|
+
|
|
46
|
+
{{< showraw src="examples/ng-class-odd/ng-class-odd.html" >}}
|
|
47
|
+
|
|
48
|
+
---
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-class
|
|
3
|
+
description: >
|
|
4
|
+
Dynamically bind one or more CSS classes using expressions.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-class` directive allows dynamically setting CSS classes on an HTML
|
|
10
|
+
element by binding to an expression. The directive supports the following
|
|
11
|
+
expression types:
|
|
12
|
+
|
|
13
|
+
- **String** — space-delimited class names.
|
|
14
|
+
- **Object** — keys as class names and values as booleans. Truthy values add the
|
|
15
|
+
class.
|
|
16
|
+
- **Array** — containing strings and/or objects as described above.
|
|
17
|
+
|
|
18
|
+
When the expression changes:
|
|
19
|
+
|
|
20
|
+
- Previously added classes are removed.
|
|
21
|
+
- New classes are added.
|
|
22
|
+
- Duplicate classes are avoided.
|
|
23
|
+
|
|
24
|
+
**Important**: Avoid using interpolation (`{{ ... }}`) in the value of the
|
|
25
|
+
`class` attribute together with `ng-class`. See
|
|
26
|
+
[interpolation known issues](../../../docs/guide/interpolation#known-issues) for
|
|
27
|
+
details.
|
|
28
|
+
|
|
29
|
+
### Animations
|
|
30
|
+
|
|
31
|
+
If `data-animate` attribute is present, the following animations will be applied
|
|
32
|
+
to the element:
|
|
33
|
+
|
|
34
|
+
| Animation | Occurs |
|
|
35
|
+
| --------------------------------------- | --------------------------------------------------- |
|
|
36
|
+
| [`add-class`](../../service/animate) | Before the class is applied to the element |
|
|
37
|
+
| [`remove-class`](../../service/animate) | Before the class is removed from the element |
|
|
38
|
+
| [`set-class`](../../service/animate) | Before classes are simultaneously added and removed |
|
|
39
|
+
|
|
40
|
+
> `ng-class` supports standard CSS3 transitions/animations even if they don’t
|
|
41
|
+
> follow `$animate` service naming conventions.
|
|
42
|
+
|
|
43
|
+
### Directive parameters
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
#### `ng-class`
|
|
48
|
+
|
|
49
|
+
- **Type:** `string | object | array`
|
|
50
|
+
- **Description:** An expression whose result determines the CSS classes to
|
|
51
|
+
apply.
|
|
52
|
+
- **Example:**
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<div ng-class="{ active: isActive, disabled: isDisabled }"></div>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Demo
|
|
59
|
+
|
|
60
|
+
{{< showhtml src="examples/ng-class/ng-class.html" >}}
|
|
61
|
+
|
|
62
|
+
{{< showraw src="examples/ng-class/ng-class.html" >}}
|
|
63
|
+
|
|
64
|
+
---
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-click
|
|
3
|
+
description: >
|
|
4
|
+
Handler for click event
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-click` directive allows you to specify custom behavior when an element
|
|
10
|
+
is clicked.
|
|
11
|
+
|
|
12
|
+
### Directive parameters
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
#### `ng-click`
|
|
17
|
+
|
|
18
|
+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
|
|
19
|
+
- **Description:** Expression to evaluate upon
|
|
20
|
+
[click](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event)
|
|
21
|
+
event.
|
|
22
|
+
[PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent)
|
|
23
|
+
object is available as `$event`.
|
|
24
|
+
- **Example:**
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<div ng-click="$ctrl.greet($event)"></div>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
#### Demo
|
|
33
|
+
|
|
34
|
+
{{< showhtml src="examples/ng-click/ng-click.html" >}}
|
|
35
|
+
|
|
36
|
+
{{< showraw src="examples/ng-click/ng-click.html" >}}
|
|
37
|
+
|
|
38
|
+
---
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-cloak
|
|
3
|
+
description: >
|
|
4
|
+
Hide interpolated templates
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-cloak` directive is used to prevent the HTML template from being briefly
|
|
10
|
+
displayed by the browser in its raw (uncompiled) form while your application is
|
|
11
|
+
loading. Use this directive to avoid the undesirable flicker effect caused by
|
|
12
|
+
the HTML template display.
|
|
13
|
+
|
|
14
|
+
The directive can be applied to the `<body>` element, but the preferred usage is
|
|
15
|
+
to apply multiple `ng-cloak` directives to small portions of the page to permit
|
|
16
|
+
progressive rendering of the browser view.
|
|
17
|
+
|
|
18
|
+
`ng-cloak` works in cooperation with the following CSS rule:
|
|
19
|
+
|
|
20
|
+
```css
|
|
21
|
+
@charset "UTF-8";
|
|
22
|
+
|
|
23
|
+
[ng-cloak],
|
|
24
|
+
[data-ng-cloak],
|
|
25
|
+
.ng-cloak,
|
|
26
|
+
.ng-hide:not(.ng-hide-animate) {
|
|
27
|
+
display: none !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ng-animate-shim {
|
|
31
|
+
visibility: hidden;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ng-anchor {
|
|
35
|
+
position: absolute;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
CSS styles are available in npm distribution:
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<link
|
|
43
|
+
rel="stylesheet"
|
|
44
|
+
href="https://cdn.jsdelivr.net/npm/@angular-wave/angular.ts/css/angular.min.css"
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Example
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<style>
|
|
52
|
+
@charset "UTF-8";
|
|
53
|
+
.ng-cloak,
|
|
54
|
+
.ng-hide:not(.ng-hide-animate),
|
|
55
|
+
[data-ng-cloak],
|
|
56
|
+
[ng-cloak] {
|
|
57
|
+
display: none !important;
|
|
58
|
+
}
|
|
59
|
+
.ng-animate-shim {
|
|
60
|
+
visibility: hidden;
|
|
61
|
+
}
|
|
62
|
+
.ng-anchor {
|
|
63
|
+
position: absolute;
|
|
64
|
+
}
|
|
65
|
+
</style>
|
|
66
|
+
<section ng-app ng-cloak>These tags are invisible {{ hello }}</section>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Demo
|
|
70
|
+
|
|
71
|
+
<style>@charset "UTF-8";.ng-cloak,.ng-hide:not(.ng-hide-animate),[data-ng-cloak],[ng-cloak]{display:none!important}.ng-animate-shim{visibility:hidden}.ng-anchor{position:absolute}</style>
|
|
72
|
+
<section ng-app ng-cloak> These tags are invisible {{ hello }} </section>
|
|
73
|
+
|
|
74
|
+
---
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-copy
|
|
3
|
+
description: >
|
|
4
|
+
Handler for copy event
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-copy` directive allows you to specify custom behavior when an element is
|
|
10
|
+
copied.
|
|
11
|
+
|
|
12
|
+
### Directive parameters
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
#### `ng-copy`
|
|
17
|
+
|
|
18
|
+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
|
|
19
|
+
- **Description:** Expression to evaluate upon
|
|
20
|
+
[copy](https://developer.mozilla.org/en-US/docs/Web/API/Element/copy_event)
|
|
21
|
+
event.
|
|
22
|
+
[ClipboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent)
|
|
23
|
+
object is available as `$event`.
|
|
24
|
+
- **Example:**
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<div contenteditable="true" ng-copy="$ctrl.greet($event)">Content</div>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### Demo
|
|
33
|
+
|
|
34
|
+
{{< showhtml src="examples/ng-copy/ng-copy.html" >}}
|
|
35
|
+
|
|
36
|
+
{{< showraw src="examples/ng-copy/ng-copy.html" >}}
|
|
37
|
+
|
|
38
|
+
---
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-cut
|
|
3
|
+
description: >
|
|
4
|
+
Handler for cut event
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-cut` directive allows you to specify custom behavior when an element is
|
|
10
|
+
cut.
|
|
11
|
+
|
|
12
|
+
### Directive parameters
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
#### `ng-cut`
|
|
17
|
+
|
|
18
|
+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
|
|
19
|
+
- **Description:** Expression to evaluate upon
|
|
20
|
+
[cut](https://developer.mozilla.org/en-US/docs/Web/API/Element/cut_event)
|
|
21
|
+
event.
|
|
22
|
+
[ClipboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent)
|
|
23
|
+
object is available as `$event`.
|
|
24
|
+
|
|
25
|
+
- **Example:**
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<div contenteditable="true" ng-cut="$ctrl.onCut($event)">
|
|
29
|
+
Cuttable content
|
|
30
|
+
</div>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
### Demo
|
|
36
|
+
|
|
37
|
+
{{< showhtml src="examples/ng-cut/ng-cut.html" >}}
|
|
38
|
+
{{< showraw src="examples/ng-cut/ng-cut.html" >}}
|
|
39
|
+
|
|
40
|
+
---
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-dblclick
|
|
3
|
+
description: >
|
|
4
|
+
Handler for dblclick event
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-dblclick` directive allows you to specify custom behavior when an
|
|
10
|
+
element is double clicked.
|
|
11
|
+
|
|
12
|
+
### Directive parameters
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
#### `ng-dblclick`
|
|
17
|
+
|
|
18
|
+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
|
|
19
|
+
- **Description:** Expression to evaluate upon
|
|
20
|
+
[dblclick](https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event)
|
|
21
|
+
event.
|
|
22
|
+
[MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent)
|
|
23
|
+
object is available as `$event`.
|
|
24
|
+
- **Example:**
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<div ng-dblclick="$ctrl.greet($event)"></div>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
#### Demo
|
|
33
|
+
|
|
34
|
+
{{< showhtml src="examples/ng-dblclick/ng-dblclick.html" >}}
|
|
35
|
+
|
|
36
|
+
{{< showraw src="examples/ng-dblclick/ng-dblclick.html" >}}
|
|
37
|
+
|
|
38
|
+
---
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ng-focus
|
|
3
|
+
description: >
|
|
4
|
+
Handler for focus event
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Description
|
|
8
|
+
|
|
9
|
+
The `ng-focus` directive allows you to specify custom behavior when an element
|
|
10
|
+
is focused.
|
|
11
|
+
|
|
12
|
+
### Directive parameters
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
#### `ng-focus`
|
|
17
|
+
|
|
18
|
+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
|
|
19
|
+
- **Description:** Expression to evaluate upon
|
|
20
|
+
[focus](https://developer.mozilla.org/en-US/docs/Web/API/Element/focus_event)
|
|
21
|
+
event.
|
|
22
|
+
[FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent)
|
|
23
|
+
object is available as `$event`.
|
|
24
|
+
- **Example:**
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<div ng-focus="$ctrl.greet($event)"></div>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
#### Demo
|
|
33
|
+
|
|
34
|
+
{{< showhtml src="examples/ng-focus/ng-focus.html" >}}
|
|
35
|
+
|
|
36
|
+
{{< showraw src="examples/ng-focus/ng-focus.html" >}}
|
|
37
|
+
|
|
38
|
+
---
|
|
File without changes
|
|
File without changes
|
|
File without changes
|