dart-polymer

Why do I get an Internal Dartium Exception when using custom elements?

泄露秘密 提交于 2019-12-22 18:29:07
问题 I am seeing this error in my console: Exception: InvalidStateError: Internal Dartium Exception PolymerDeclaration.registerType (package:polymer/src/declaration.dart:241:22) PolymerDeclaration.register (package:polymer/src/declaration.dart:175:17) PolymerDeclaration._register (package:polymer/src/declaration.dart:114:13) PolymerDeclaration.registerWhenReady (package:polymer/src/declaration.dart:109:14) _notifyType (package:polymer/src/declaration.dart:514:49) Polymer.register (package:polymer

Is there the a way to prevent HTML escaping inside a Polymer expression? [duplicate]

孤人 提交于 2019-12-22 08:55:35
问题 This question already has an answer here : How can I bind a text which contains url as html (1 answer) Closed 5 years ago . My colleague Patrick & I currently converting an autocomplete component from Web UI to Polymer.dart.In Web UI we provided a HTML rendered list to the autocomplete in order to give a programmer the opportunity to style the results. Based on the input's value we filtered the list and displayed the matching results. What would you recommend to achieve the same behaviour in

How to use and to iterate an observable map in Dart Polymer?

痞子三分冷 提交于 2019-12-22 06:27:13
问题 Consider the following code: myexample.html <polymer-element name="my-example"> <script type="application/dart" src="myexample.dart"></script> <template> <style></style> <div> <ul> <template repeat="{{ entry in map.values }}"> <li>{{ entry }}</li> </template> </ul> <button on-click="{{add}}">Add</button> </div> </template> </polymer-element> myexample.dart @CustomTag('my-example') class MyExample extends PolymerElement { @observable Map<int, String> map = toObservable({}); int i = 0;

How to register a PolymerExpression filter inside a custom element, in Polymer.dart?

主宰稳场 提交于 2019-12-21 21:09:07
问题 How do I register a PolymerExpression filter inside a custom element? I am using Polymer.dart. I want to use this: <div>Uppercase: {{bob.fullName | uppercase}}</div> inside the template of my custom element. Where do I register uppercase ? 回答1: I tried Seth answer and the expressions themselves are working but somehow I am losing events on my component. My on-click event was not working anymore when I was using: DocumentFragment instanceTemplate(Element template) => template.createInstance

How to deploy a Dart Polymer app to Javascript using dart2js

南楼画角 提交于 2019-12-21 19:46:23
问题 I got a problem while deploying Dart code using Polymer to Javascript. I've created a polymer application with DartEditor and made a simple example. This example works in Dartium but when I try to build it as a Polymer App (in Javascript) and launch it, the app fails. How am I supposed to convert a Dart Polymer app to Javascript ? Here's the example code I made that fails : example.html : <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Example</title> <link rel="import" href=

How to make a polymer element draggable

此生再无相见时 提交于 2019-12-21 03:55:14
问题 I'm trying to enable HTML5 drag and drop on a custom polymer element but it doesn't work. Without polymer it's possible to just add the draggable attribute. Here is my code in Dart: my_component.html <polymer-element name="my-component"> <template> <style> @host { :scope { display: block; } } div { background-color: red; width: 200px; height: 200px; } </style> <div> Drag me </div> </template> <script type="application/dart" src="my_component.dart"></script> </polymer-element> my_component

Dart Polymer: How to filter elements in repeat-template?

☆樱花仙子☆ 提交于 2019-12-20 14:09:26
问题 I'm using the repeat template of Dart Polymer to show the items of list. Now, I would like to implement a search filter, where only the items are displayed, which relates to the typed search term. Consider the following code: my-element.html <polymer-element name="my-element"> <script type="application/dart" src="my-element.dart"></script> <template> <input type="text" value="{{ searchTerm }}"> <ul> <template repeat="{{ item in items }}"> <template if="{{ matchesSearchFilter(item) }}"> <li>{{

Custom Events in Nested Polymer Dart UI

∥☆過路亽.° 提交于 2019-12-20 07:10:40
问题 I am having some difficulty conceptualizing how to access a specific CustomEvent. Here is my issue. I have a name-form.html that I import in nok.html and pt.html . name-form.html has a custom event that publishes the observable model for the form. This published model is then subscribed to by the detail parameter of the CustomEvent. The problem is although I have three different forms to capture a name each with a different context, name-form.html will fire the same custom event. My thoughts

Instance of Paper elements in dart

喜你入骨 提交于 2019-12-20 03:28:05
问题 How can I get an instance to the paper-input element below? HTML file: <!DOCTYPE html> <html> <head> <!-- <script src='packages/web_components/platform.js'></script> not necessary anymore with Polymer >= 0.14.0 --> <script src='packages/web_components/dart_support.js'></script> <link rel='import' href='packages/paper_elements/paper_input.html'> <script src='packages/browser/dart.js'></script> </head> <body fullbleed unresolved> <paper-input id='subject' label='subject'></paper-input> <script

Databinding of polymer paper_input does not work

两盒软妹~` 提交于 2019-12-20 03:26:09
问题 I have the following code where a 2-way binding is expected between first_name and the property val. <!DOCTYPE html> <link rel="import" href="packages/polymer/polymer.html"> <link rel="import" href="packages/paper_elements/paper_input.html" > <polymer-element name='paper-input-snippet'> <template> <div on-mouseout="{{zoom}}"> <paper-input label="First" floatinglabel error="Invalid input" id="first_name" value='{{val}}'> </paper-input> <paper-input label="Middle" floatinglabel error="Invalid