Skip to content

Commit

Permalink
[docs] domvm.createView(MyView) w/es6-class-views
Browse files Browse the repository at this point in the history
  • Loading branch information
leeoniya committed Mar 25, 2017
1 parent 192d132 commit f1cb979
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ class MyView extends View {
var vm = new MyView();

vm.mount(document.body);

// or...

var vm = domvm.createView(MyView).mount(document.body);
```

`this === vm`. See [/demos/es6-class-views.html](/demos/es6-class-views.html) for more details.
Expand Down
6 changes: 5 additions & 1 deletion demos/es6-class-views.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@

setInterval(function() {
vm.setState({i: ++vm.state.i});
}, 500)
}, 500);

console.log(vm instanceof MyView);

// and also

var vm4 = domvm.createView(MyView3).mount(document.body);
</script>
</body>
</html>

0 comments on commit f1cb979

Please sign in to comment.