changes in the docs: rename modules to components, change idiomatic controller and view usage
This commit is contained in:
parent
0addce57ba
commit
d5619d412e
19 changed files with 395 additions and 692 deletions
|
|
@ -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>
|
||||
|
|
@ -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())
|
||||
];
|
||||
]);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue