Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

Commit

Permalink
Added Glimmer component example to Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ppcano committed Feb 22, 2019
1 parent 5aeecbc commit 9a4070e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,35 @@ Included:
- ember-auto-import
- no jquery

### Glimmer Component Example

```src/ui/components/counter/component.js
import Component from '@ember/component';

This comment has been minimized.

Copy link
@bobisjan

bobisjan Feb 23, 2019

Contributor

Should be the Glimmer component imported from @glimmer/component per RFC#416?

This comment has been minimized.

Copy link
@NullVoxPopuli

NullVoxPopuli Feb 23, 2019

Collaborator

Yes! You are correct.

import { tracked } from '@glimmer/tracking';

export default class HolaComponent extends Component {
@tracked count = 0;

increment() {
this.count++;
}

decrement() {
this.count--;
}
}

```

```src/ui/components/counter/template.hbs
Count: {{this.count}}
<br/>
<button {{action this.increment}}>Click to increase</button>
<button {{action this.decrement}}>Click to decrease</button>
```


## Building/Contributing:
```bash
Expand Down

0 comments on commit 9a4070e

Please sign in to comment.