-
-
Save ciscoheat/4f43644592b6b3d49c38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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