### @view ##### counter.js ```js import { component, view, on } from 'app-decorators'; @view(`

{{header}}

{{count}}
+ -
`) @component() class Counter { @view.bind count; @on('click .up') onClickUp() { ++this.count } @on('click .down') onClickUp() { --this.count } } ``` ##### create in html: ```html ``` ##### create directly with javascript ```html let counter = Counter.create({ header: 'My Counter', count: 0, }); document.body.appendChild(counter); ``` ##### will render: ```html

My Counter

0
+ -
``` --- ##### using slot: ```js import { component, view, on } from 'app-decorators'; @view(`

{{count}}
+ -
`) @component() class Counter { @view.bind count; @on('click .up') onClickUp() { ++this.count } @on('click .down') onClickUp() { --this.count } } ``` ```html My Counter ``` ##### will render: ```html

My Counter

0
+ -
``` --- ##### it also possible nested components for complex structures: ```js // myparent.js @component({ name: 'my-parent', }) @view(`
`) class MyParent { } //mychild.js @component({ name: 'my-child', }) @view(` `) class MySister { } // mysister.js @component({ name: 'my-sister', }) @view('

sister

') class MySister { } ``` #### then slot the components together ```html

Hello World ``` ##### will render: ```html

  • One
  • Two
  • Hello World

    sister

```