How to bind FileList to Observable in Dart Polymer?

Issue I’m trying to use a file upload in combination with Dart & Polymer. Consider the following files: my-upload.html <polymer-element name=”my-upload”> <template> <style></style> <input type=”file” id=”uploader” bind-files=”{{files}}” on-change=”{{uploadFiles}}” multiple> </template> <script type=”application/dart” src=”my-upload.dart”></script> </polymer-element> my-upload.dart @CustomTag(‘my-upload’) class MyUpload extends PolymerElement

Continue reading

instanceTemplate in polymer 0.8.7

Issue This question is a follow up question to this question. After upgrading to polymer 0.8.7 the following code stopped working: DocumentFragment instanceTemplate(Element template) => template.createInstance(this, new PolymerExpressions(globals: { ‘splitnewline’: (String input) => input.split(“\n”) })); Looks like Element doesn’t contain

Continue reading

Dart Polymer asynchronous property changes not working

Issue I’m having trouble updating Dart Polymer elements asynchronously. Let’s say I have a simple element that contains a label and a text input. The template <polymer-element name=”control-text”> <template> <label for=”{{id}}”>{{label}}</label> <input id=”{{id}}” value=”{{value}}” type=”text” /> </template> <script type=”application/dart” src=”control-text.dart”></script>

Continue reading

Bind content containing html tags

Issue How can I display content containing html tags like <br> inside a polymer-element like: <polymer-element name=”my-element”> <template> {{mylongtext}} </template> <script …></script> </polymer-element> @CustomTag(“my-element”) class MyElement extends PolymerElement { @observable string mylongtext = “bla bla <br> bla bla <strong> bla

Continue reading