changes in the docs: rename modules to components, change idiomatic controller and view usage

This commit is contained in:
Leo Horie 2015-04-06 22:41:38 -04:00
parent 0addce57ba
commit d5619d412e
19 changed files with 395 additions and 692 deletions

View file

@ -5,5 +5,5 @@
<script src="../mithril.min.js"></script>
<script src="template-converter.js"></script>
<script>
m.module(document.getElementById("converter"), templateConverter);
m.mount(document.getElementById("converter"), templateConverter);
</script>

View file

@ -82,9 +82,9 @@ templateConverter.controller = function() {
};
templateConverter.view = function(ctrl) {
return [
return m("div", [
m("textarea", {autofocus: true, style: {width:"100%", height: "40%"}, onchange: m.withAttr("value", ctrl.source)}, ctrl.source()),
m("button", {onclick: ctrl.convert.bind(ctrl)}, "Convert"),
m("textarea", {style: {width:"100%", height: "40%"}}, ctrl.output())
];
]);
};