Skip to content
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.

Commit

Permalink
correct js example
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Westby committed Jul 26, 2016
1 parent 70da21f commit fb80cc5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,18 @@ main =

**app.js**
```javascript
var app = Elm.Main.worker()
app.ports.modelOut.subscribe(function (model) {
document.getElementById('seconds').innerHTML = model.toString()
window.addEventListener('loaded', function () {
var app = Elm.Main.worker()

app.ports.modelOut.subscribe(function (model) {
document.getElementById('count').innerHTML = model;
})

document
.getElementById('incrementButton')
.addEventListener('click', function () {
app.ports.messagesIn.send('Increment')
})
})
```

Expand Down

0 comments on commit fb80cc5

Please sign in to comment.