Skip to content

Commit 8579b06

Browse files
committed
switch default template event link to method calls and add decorators to the template list
1 parent 47c1c2b commit 8579b06

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

docs/0.8/Templates.md.hbs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,26 @@ For reference, however, the differences between Ractive templates and HTML are l
1111

1212
The most obvious difference is that Ractive templates contain {{{createLink 'mustaches'}}} to facilitate data binding.
1313

14-
## Proxy event directives
14+
## Event directives
1515

16-
Elements in a Ractive template can have {{{createLink 'proxy events' 'events' }}}, which look like attributes but don't get rendered to the DOM as attributes (they are intercepted, and used as event binding instructions instead):
16+
Elements in a Ractive template can have {{{createLink 'method calls' 'events' }}}, which look like attributes but don't get rendered to the DOM as attributes (they are intercepted, and used as event binding instructions instead):
1717

1818
```html
19-
<button on-click='activate'>Activate!</button>
19+
<button on-click='@this.activate()'>Activate!</button>
2020
```
2121

2222
## Transitions
2323

2424
Another item in the set of things-that-look-like-attributes-but-aren't, {{{createLink 'transitions'}}} allow you to specify how elements should behave when they first get introduced to the DOM and when they get removed from it later:
2525

2626
```html
27-
<div intro='fade'>This element will fade in gradually when it renders</div>
27+
<div fade-in>This element will fade in gradually when it renders</div>
28+
```
29+
30+
## Decorators
31+
32+
{{{createLink 'Decorators'}}} can decorate elements as they are rendered to the DOM. These also look like attributes, but they never get added to the DOM themselves.
33+
34+
```html
35+
<div as-ace-editor>This element will be turned into an Ace Editor.</div>
2836
```

docs/edge/Templates.md.hbs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,26 @@ For reference, however, the differences between Ractive templates and HTML are l
1111

1212
The most obvious difference is that Ractive templates contain {{{createLink 'mustaches'}}} to facilitate data binding.
1313

14-
## Proxy event directives
14+
## Event directives
1515

16-
Elements in a Ractive template can have {{{createLink 'proxy events' 'events' }}}, which look like attributes but don't get rendered to the DOM as attributes (they are intercepted, and used as event binding instructions instead):
16+
Elements in a Ractive template can have {{{createLink 'method calls' 'events' }}}, which look like attributes but don't get rendered to the DOM as attributes (they are intercepted, and used as event binding instructions instead):
1717

1818
```html
19-
<button on-click='activate'>Activate!</button>
19+
<button on-click='@this.active()'>Activate!</button>
2020
```
2121

2222
## Transitions
2323

2424
Another item in the set of things-that-look-like-attributes-but-aren't, {{{createLink 'transitions'}}} allow you to specify how elements should behave when they first get introduced to the DOM and when they get removed from it later:
2525

2626
```html
27-
<div intro='fade'>This element will fade in gradually when it renders</div>
27+
<div fade-in>This element will fade in gradually when it renders</div>
28+
```
29+
30+
## Decorators
31+
32+
{{{createLink 'Decorators'}}} can decorate elements as they are rendered to the DOM. These also look like attributes, but they never get added to the DOM themselves.
33+
34+
```html
35+
<div as-ace-editor>This element will be turned into an Ace Editor.</div>
2836
```

0 commit comments

Comments
 (0)