polymer

[dom-repeat::dom-repeat]: expected array for `items`, found Object

こ雲淡風輕ζ 提交于 2019-12-24 05:47:22
问题 I have the following template: <iron-ajax id="ajax" url="backend/api.php?operacion=contenidos&idf=[[datos.id]]&len=[[len]]" handle-as="json" verbose=true last-response={{ajaxResponse}} loading="{{cargando}}"> </iron-ajax> <template is="dom-repeat" items="[[ajaxResponse]]"> The AJAX response contains the following JSON (correct): { "1": [{ "id": "6", "idfolleto": "1", "fila": "1", "orden": "1", "tipo": "carrousel", "titulo": "", "subtitulo": null, "color1": null, "color2": null, "color_fondo":

Template repeat not working for nested list (Polymer.dart)

只谈情不闲聊 提交于 2019-12-24 05:30:42
问题 Due to the lack of multi-dimensional array support in dart, I thought of using List. Dart code : class MyModel extends Object with Observable { @observable List<List<int>> dataList = toObservable(new List<List<int>>()); } void main() { initPolymer().run(() { Polymer.onReady.then((_) { var template = querySelector("#bindValueTemplate") as AutoBindingElement; var model = template.model = new MyModel(); for (int i=0; i<2;i++) { List<int> in1 = new List<int>(); for (int j=0; j<2; j++) { in1.add(j

Polymer 2.0 webcomponents-loader.js is missing Edge polyfill

给你一囗甜甜゛ 提交于 2019-12-24 05:09:12
问题 We currently updated a project from Polymer 1 to the Polymer 2/ hybrid version. I know that webcomponents-hi-sd-ce.js is the polyfill for edge. When testing the page on Microsoft Edge I now get an error indicating that webcomponents-hi-sd-ce.js.map could not be found (404). The same error occurs when loading the project with webcomponents-lite.js I couldn't find similar cases so I figured this might be a issue in Polymer 2. I tried importing the script directly by myself but that didn't help

How to submit a form with polymer?

Deadly 提交于 2019-12-24 04:32:13
问题 I've have this polymer contact-element: <polymer-element name="contact-element"> <template> <paper-input label="Your Name" id="contact-name" floatingLabel></paper-input> <paper-input multiline label="Your text here..." id="contact-message" floatingLabel></paper-input> <paper-button label="Send Data" id="contact-submit" raisedButton></paper-button> </template> <script> Polymer({}); </script> </polymer-element> It's included in this index.html <form action="/sendMessage" method="GET"> <contact

How to submit a form with polymer?

允我心安 提交于 2019-12-24 04:32:10
问题 I've have this polymer contact-element: <polymer-element name="contact-element"> <template> <paper-input label="Your Name" id="contact-name" floatingLabel></paper-input> <paper-input multiline label="Your text here..." id="contact-message" floatingLabel></paper-input> <paper-button label="Send Data" id="contact-submit" raisedButton></paper-button> </template> <script> Polymer({}); </script> </polymer-element> It's included in this index.html <form action="/sendMessage" method="GET"> <contact

Issue with upgrade to Polymer 0.5.1 and styling paper-dialog

寵の児 提交于 2019-12-24 04:28:08
问题 So I just updated my project from Polymer v0.4.2 to v0.5.1 of the Polymer library. One thing that seemed to have changed is how the paper-dialog element is implemented. In v0.4.2, when I had a paper-dialog inside of my custom element, I could customize it with CSS inside of my element using core-style elements. In v0.5.1, if I understand correctly, the paper-dialog is no longer implemented inside my component, but instead it's implemented in the core-overlay-layer element which is in the html

How to extend paper-dropdown-menu for a reusable custom element list?

五迷三道 提交于 2019-12-24 03:57:30
问题 I have a list of time zones that needs to be a reusable component. How do I make my list of time zones a reusable component in Polymer? I need this custom element to provide whether a time zone was selected (isSelected) and a function or property to get the selected time zone name. This is driving me mad! Thanks in advance. Below is a component file called, 'time-zones.html'. I removed all the BS JavaScript I was trying because clearly it wasn't working. The only thing working is the loading

Parent element is ready before its child - Polymer 1.0

一曲冷凌霜 提交于 2019-12-24 03:55:12
问题 This question had been modified to match the actual problem. The original question mistakingly focused on iron-ajax, please see the original problem below. The question should have been: Please advice why child iron-ajax element is not ready during the 'ready' callback of my-component defined as follows: <dom-module id="my-component"> <template> <link rel="import" href="../../../bower_components/iron-ajax/iron-ajax.html"> <iron-ajax id="selectionLoader" url="" method="GET" handle-as="json"

Polymer, how to pass value to paper-date-picker attribute that expects string?

混江龙づ霸主 提交于 2019-12-24 03:35:17
问题 I'm trying to use paper-date-picker inside my element. How to pass value to paper-date-picker's 'date' attribute? <!-- This is working: --> <paper-date-picker date="2000/1/21"></paper-date-picker> <!-- This is NOT working: Inside <my-birthdate birthdate="1977/1/2"></my-birthdate> --> <paper-date-picker date='{{birthdate}}'></paper-date-picker> Here is the Plunk. 回答1: After looking at the source for the date-picker, it doesn't handle text very well. Basically, you have to add an observer that

Data binding in Polmyer's <test-fixture>

好久不见. 提交于 2019-12-24 03:06:13
问题 I am trying to test a custom Polymer element using their web-component-tester. Many of the examples make use of test-fixture. I would like to test my custom element using databinding, but I'm struggling to get data binding to work. Essentially, I want to take my custom element, assume that the variables are bound, and assert things about it. I'm trying to follow the example in the test-fixture README. Note also that I originally posted this question on their issue tracker before realizing