Skip to content

Instantly share code, notes, and snippets.

@ciscoheat
Forked from freakinruben/gist:c6dd102af2f1cc1a9ce7
Last active August 29, 2015 14:24
Show Gist options
  • Save ciscoheat/4f43644592b6b3d49c38 to your computer and use it in GitHub Desktop.
Save ciscoheat/4f43644592b6b3d49c38 to your computer and use it in GitHub Desktop.
import js.Browser;
import mithril.M;
class App implements Mithril {
public static function main() {
M.mount(Browser.document.body, new App());
}
var tests = [];
public function new() {
for (i in 0...5) {
tests.push(M.component(new TestComponent()));
}
}
public function view() m(".app", tests);
}
import mithril.M;
class TestComponent implements Mithril {
private static var nr = 0;
@prop private var testVar : String;
public function new() testVar = M.prop("test"+(nr++));
public function view() m("p", testVar());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment