Created
March 16, 2014 07:03
-
-
Save gnuwilliam/9579555 to your computer and use it in GitHub Desktop.
Simple Dart helper class to add new button elements
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
class DartBtn { | |
ButtonElement addButton(id, text, btnClass, container) { | |
var button = new ButtonElement(); | |
button..id = id | |
..text = text | |
..classes.add(btnClass); | |
querySelector(container).children.add(button); | |
return button; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage example