polymer

What is the correct way to clone a polymer element?

╄→гoц情女王★ 提交于 2019-12-07 07:33:42
问题 I have been trying to clone polymer elements - typically elements that have been created from data of some kind, so it is not an option to just create a new instance of the template with the constructor or document.createElement . element.cloneNode does not work on its own as it does not copy the shadow-root lodash proposed by Polymer Clone Objects does not seem to do anything (cloned object is empty) cloneEl.shadowRoot.innerHTML = sourceEl.shadowRoot.innerHTML; copies the shadow-root, but

How do you nest two of Polymer's firebase-collection elements inside dom-repeat?

坚强是说给别人听的谎言 提交于 2019-12-07 06:33:07
问题 I have a problem of looping two of Polymers firebase-collection elements. With my database structure i first have to check which events the user has access to, then get the information on that event from events. The problem with this code is that when i loop the second firebase-collection the data-binding on "events" will be the same on all that repeats and therefore it will be the same name on every h4. So is there a way of having a unique variable in data="{{ }}". or is there a better way

Polymer 1.0: Using template dom-repeat inside paper-menu elements to display iron-pages on selection

随声附和 提交于 2019-12-07 03:39:00
问题 Using Polymer 1.0, I have created a paper-drawer-panel layout. In the drawer I have a menu using paper-menu with paper-items which are bound to the iron-pages. I took this example from Content Switcheroo with Core-Pages -- Polycasts #09 and converted it to use the Polymer 1.0 elements. In the code below you can see my commented section in which the paper-items are hard-coded. This works fine. My next step was to try and build my menu dynamically by using the <template is="dom-repeat"> element

Polymer 1.0 - paper-ripple goes all over the screen instead fit in the element

浪尽此生 提交于 2019-12-07 03:16:27
问题 I'm trying to use the ripple effect on a clickable list of items but I'm facing the issue that the ripple effect goes all over the screen when I encapsulate that list into a custom element. It works great if I place it in my index.html but fails when I create a custom element that is included there. See an image of the issue: I've been reading similar questions where the answer is to make the container relative, which should be already done. So I'm wondering if it is required to set any

Polymer 3.0 Uncaught DOM Exception When using Paper-Input

你。 提交于 2019-12-07 02:11:32
问题 When Using paper-input , the import throws the following exception Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry. I haven't done anything besides creating the template for 3.0 and adding the import. There seems to be an issue with the Migration Tool , Google used to update their old components. Has anybody sorted this already? 回答1: UPDATE The issue is caused by two different versions of iron-meta in node

Polymer RESTful CRUD app

不羁岁月 提交于 2019-12-07 00:55:26
问题 I have a Users resource that consumes and produces JSON. I want to make RESTful calls (GET,POST,PUT,DELETE) in Polymer. Any example app or link to resources. 回答1: I made this Polymer app for an Open Source domotic project: https://github.com/NikZar/nautes-freedomotic-dashboard You can take a look at my: fd-rest-element-service.html and see how it gets used in the application. I hope this helps :) 来源: https://stackoverflow.com/questions/24600326/polymer-restful-crud-app

polymer iron-ajax : How to Bind data from input element to iron-ajax's body attribute

只谈情不闲聊 提交于 2019-12-07 00:09:05
问题 I recently have problems binding data from input element to iron-ajax's "body" attribute. When I used core-ajax on polymer 0.5, I can easily bind values like this: <core-ajax id="ajax" method="POST" contentType="application/json" url="{{url}}" body='{"username":"{{username}}", "password":"{{password}}"}' handleAs="json" on-core-response="{{responseHandler}}"> </core-ajax> Now I tried the same thing with iron-ajax. But it sends literally "{{username}}" and "{{password}}" instead of their

paper-dialog in Polymer doesn't close in iPhone

假装没事ソ 提交于 2019-12-06 21:57:55
问题 I use this example from the doc of polymer <paper-dialog> <h2>Header</h2> <paper-dialog-scrollable> Lorem ipsum... </paper-dialog-scrollable> <div class="buttons"> <paper-button dialog-dismiss>Cancel</paper-button> <paper-button dialog-confirm>Accept</paper-button> </div> </paper-dialog> In every browser the dialog closes when I click on place that is not the dialog, But on iPhone IOS 8.4 it doesn't work. I can't close the dialog. How can I solve this problem? 回答1: I know there is a Z-index

document.querySelector() returns null

偶尔善良 提交于 2019-12-06 18:34:51
问题 I'm creating a polymer element. I've made the template and am now working on the script. For some reason document.querySelector is returning null for both class and id selectors. Not sure if this doesn't work with polymer (no reason it shouldn't) or I haven't imported something or what else is wrong. event-card.html <link rel="import" href="../components/polymer/polymer.html"> <link rel="import" href="event-card-description.html"> <polymer-element name="event-card" attributes="header image

Updating Polymer component via Websocket?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 18:30:16
问题 I want to find the simplest possible way (preferably without relying on a lot of additional libraries) to connect a Polymer component with a web socket so that I can update it easily from the backend. Right now I have investigated doing this with bacon.js since it is very easy to setup a an event stream directly from the web socket. My idea is to filter these messages and route them to individual Polymer components. However, if this can be easily done without bacon.js or other libraries (i.e.