Merge pull request #1362 from pine3ree/patch-1

upgrade doc: rename ctrl to state
This commit is contained in:
Leo Horie 2016-10-24 10:29:06 -04:00 committed by GitHub
commit 14ef350d6f

View file

@ -134,15 +134,15 @@ m.mount(document.body, {
m.mount(document.body, {
oninit : function(vnode) {
var ctrl = this; // this is bound to vnode.state by default
var state = this; // this is bound to vnode.state by default
ctrl.fooga = 1;
state.fooga = 1;
},
view : function(vnode) {
var ctrl = this; // this is bound to vnode.state by default
var state = this; // this is bound to vnode.state by default
return m("p", ctrl.fooga);
return m("p", state.fooga);
}
});
```