rework api

This commit is contained in:
Leo Horie 2015-04-09 22:44:45 -04:00
parent 6abb868c6b
commit 9e8dc6998d
14 changed files with 830 additions and 345 deletions

View file

@ -26,7 +26,7 @@
<h3 id="core">Core</h3>
<ul>
<li><a href="mithril.html" title="A utility to create virtual elements">m</a></li>
<li><a href="mithril.component.html" title="Creates a component">m.component</a></li>
<li><a href="mithril.component.html" title="Parameterizes a component">m.component</a></li>
<li><a href="mithril.mount.html" title="Renders a component">m.mount</a></li>
<li><a href="mithril.prop.html" title="A getter-setter utility">m.prop</a></li>
<li><a href="mithril.withAttr.html" title="A event handler factory utility">m.withAttr</a></li>

View file

@ -84,7 +84,7 @@ var Page = {
}
};
var Demo = m.component({
var Demo = {
//controller
controller: function() {
var pages = Page.list();
@ -105,7 +105,7 @@ var Demo = m.component({
m("button", {onclick: ctrl.rotate}, "Rotate links")
]);
};
});
};
//initialize
@ -124,7 +124,7 @@ var Page = {
}
};
var Demo = m.component({
var Demo = {
//controller
controller: function() {
var pages = Page.list();
@ -145,7 +145,7 @@ var Demo = m.component({
m("button", {onclick: ctrl.rotate}, "Rotate links")
]);
};
});
};
//initialize