Created
December 26, 2013 18:35
-
-
Save sethladd/8137158 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Addtotable</title> | |
| <link rel="stylesheet" href="addtotable.css"> | |
| <link rel="import" href="my_table.html"> | |
| <script type="application/dart">export 'package:polymer/init.dart';</script> | |
| <script src="packages/browser/dart.js"></script> | |
| </head> | |
| <body> | |
| <h1>Addtotable</h1> | |
| <table id="foo"> | |
| </table> | |
| <my-table></my-table> | |
| <!-- <script type="application/dart" src="addtotable.dart"></script>--> | |
| </body> | |
| </html> |
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
| import 'package:polymer/polymer.dart' show PolymerElement, CustomTag; | |
| import 'dart:html' show TableElement, querySelector; | |
| @CustomTag('my-table') | |
| class MyTable extends PolymerElement { | |
| MyTable.created() : super.created() { | |
| foo(); | |
| } | |
| @override | |
| void foo() { | |
| var table = querySelector('#foo') as TableElement; | |
| for (var i = 0; i < 10; i++) { | |
| var row = table.addRow(); | |
| row.addCell().innerHtml = 'Hello from $i'; | |
| } | |
| } | |
| } |
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
| <polymer-element name="my-table"> | |
| <template> | |
| <table id="#foo"></table> | |
| </template> | |
| <script type="application/dart" src="my_table.dart"></script> | |
| </polymer-element> |
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
| name: addtotable | |
| description: A sample web application | |
| dependencies: | |
| browser: any | |
| polymer: any | |
| transformers: | |
| # custom <mortgage_calculator transformers> | |
| - polymer: | |
| entry_points: | |
| - web/addtotable.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment