Skip to content

Commit dfbe79f

Browse files
committed
ngOnline and ngOffline docs
1 parent 28301cd commit dfbe79f

File tree

5 files changed

+100
-18
lines changed

5 files changed

+100
-18
lines changed
Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
---
2-
title: ng-channel
2+
title: ng-offline
33
description: >
4-
Subscribe a template to a messaging service topic
4+
Handler for offline event
55
---
66

77
### Description
88

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 to be evaluated and
17-
rendered.
18-
19-
The directive automatically unsubscribes from the event channel when the scope
20-
is destroyed.
9+
The `ng-offline` directive allows you to specify custom behavior when pressing
10+
keys, regardless of whether they produce a character value.
2111

2212
### Parameters
2313

2414
---
2515

26-
#### `ng-channel`
16+
#### `ng-offline`
17+
18+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
19+
- **Description:** Expression to evaluate upon `Window`
20+
[offline](https://https://developer.mozilla.org/en-US/docs/Web/API/Window/offline_event)
21+
event. [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event) object
22+
is available as `$event`.
23+
- **Example:**
2724

28-
- **Type:** `string`
29-
- **Description:** The name of the channel to subscribe to using `$eventBus`.
25+
```html
26+
<div ng-offline="offline = true">{{ offline }}</div>
27+
```
28+
29+
---
3030

3131
#### Demo
3232

33-
{{< showdemo src="examples/ng-channel/ng-channel.html" >}}
33+
{{< showhtml src="examples/ng-offline/ng-offline.html" >}}
34+
35+
{{< showraw src="examples/ng-offline/ng-offline.html" >}}
3436

3537
---
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: ng-offline
3+
description: >
4+
Handler for offline event
5+
---
6+
7+
### Description
8+
9+
The `ng-offline` directive allows you to specify custom behavior when pressing
10+
keys, regardless of whether they produce a character value.
11+
12+
### Parameters
13+
14+
---
15+
16+
#### `ng-offline`
17+
18+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
19+
- **Description:** Expression to evaluate upon `Window`
20+
[offline](https://https://developer.mozilla.org/en-US/docs/Web/API/Window/offline_event)
21+
event. [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event) object
22+
is available as `$event`.
23+
- **Example:**
24+
25+
```html
26+
<div ng-offline="offline = true">{{ offline }}</div>
27+
```
28+
29+
---
30+
31+
#### Demo
32+
33+
{{< showhtml src="examples/ng-offline/ng-offline.html" >}}
34+
35+
{{< showraw src="examples/ng-offline/ng-offline.html" >}}
36+
37+
---
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: ng-online
3+
description: >
4+
Handler for online event
5+
---
6+
7+
### Description
8+
9+
The `ng-online` directive allows you to specify custom behavior when pressing
10+
keys, regardless of whether they produce a character value.
11+
12+
### Parameters
13+
14+
---
15+
16+
#### `ng-online`
17+
18+
- **Type:** [Expression](../../../typedoc/types/Expression.html)
19+
- **Description:** Expression to evaluate upon `Window`
20+
[online](https://https://developer.mozilla.org/en-US/docs/Web/API/Window/online_event)
21+
event. [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event) object
22+
is available as `$event`.
23+
- **Example:**
24+
25+
```html
26+
<div ng-online="online = true">{{ online }}</div>
27+
```
28+
29+
---
30+
31+
#### Demo
32+
33+
{{< showhtml src="examples/ng-online/ng-online.html" >}}
34+
35+
{{< showraw src="examples/ng-online/ng-online.html" >}}
36+
37+
---
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<section ng-app>
2+
<div ng-offline="offline = true">Disconnected: {{ offline }}</div>
3+
</section>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<section ng-app>
2+
<div ng-online="online = true">Connected: {{ online }}</div>
3+
</section>

0 commit comments

Comments
 (0)