rename ctrl to state
I am not sure you agree, but i find the name `state` a bit less confusing that the name `ctrl` used in v 0.2.x. thank you and kind regards
This commit is contained in:
parent
912d4a303d
commit
ce93bdbb79
1 changed files with 4 additions and 4 deletions
|
|
@ -134,15 +134,15 @@ m.mount(document.body, {
|
||||||
|
|
||||||
m.mount(document.body, {
|
m.mount(document.body, {
|
||||||
oninit : function(vnode) {
|
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) {
|
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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue