Created
May 9, 2017 04:04
-
-
Save Meai1/4a1ef038cc0b56159644ccd4a150602b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @JS() | |
| library IncrementalDOM; | |
| import 'dart:html'; | |
| import 'dart:async'; | |
| import 'package:js/js.dart'; | |
| @JS() | |
| external void elementOpenStart(String nameOrCtor, | |
| [String key = "", List<String> statics]); | |
| @JS() | |
| external void attr(String name, dynamic value); | |
| @JS() | |
| external Element elementOpenEnd(); | |
| @JS() | |
| external Element patch(Element node, Function fn, {dynamic data}); | |
| void mycallback(e) { | |
| print("hello"); | |
| } | |
| void render() { | |
| var s1 = [ 'type', 'text', 'placeholder', '…']; | |
| elementOpenStart('input', '1', s1); | |
| attr("value", 12345); | |
| attr("onkeyup", allowInterop(mycallback)); | |
| elementOpenEnd(); | |
| } | |
| Future main() async { | |
| patch(document.getElementById('container'), render); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Getting: