Closed krisnye closed 11 years ago
<!DOCTYPE html> <html> <head> <script src="polymer.min.js" debug></script> <element name="v-bug"> <template> <span data-sample="{{data}}" on-click="clicked">Click Me</span> </template> <script> Polymer.register(this, { data: { alpha: 1, beta: 2 }, clicked: function(e, a, element) { alert("Expected: " + JSON.stringify(this.data) + "\n" + "Actual: " + JSON.stringify(element.dataset.sample)); } }); </script> </element> </head> <body> <v-bug></v-bug><br> </body> </html>
Actually, it looks like custom-data does not allow anything other than a String value to be stored. There should be some way however to store an object onto an element and get the actual object value back later.