polymer

Styling Polymer paper-slider

纵饮孤独 提交于 2019-12-29 01:41:14
问题 So I'm essentially wrapping the standard paper-slider element with a custom element, and wanting to include some styling. Below is what I currently have: <dom-module id="my-slider"> <template> <style> /* Works */ paper-slider { --paper-slider-active-color: red; --paper-slider-knob-color: red; --paper-slider-height: 3px; } /* Doesn't work */ paper-slider #sliderContainer.paper-slider { margin-left: 0; } /* Also doesn't work */ .slider-input { width: 100px; } </style> <div> <paper-slider

How to resolve "Attributes on element-name were data bound prior to Polymer upgrading the element?

二次信任 提交于 2019-12-28 17:42:11
问题 Since the latest version of Polymer (0.2.4) I get the following warning for a bunch of elements: Attributes on us-requests-list were data bound prior to Polymer upgrading the element. This may result in incorrect binding types. How do I resolve this warning? I've found the following issue on Github: https://github.com/Polymer/polymer-dev/issues/20 Where they say: Bindings made to an element before it is upgraded can end up being attribute bindings where property bindings were expected.

Polymer automatic node finding with dynamic id value

£可爱£侵袭症+ 提交于 2019-12-28 05:54:48
问题 How can I access node that have dynamic id value using Polymer node finding by id? For example <template> <div id="{{ id }}"></div> </template> and in js Polymer("my-element", { ready: function() { if (!this.id) { this.id = 'id' + (new Date()).getTime(); } console.log(this.$.id); // this part needs to find my div element } }); 回答1: It's true that a JavaScript hash can be accessed using either dot . or array [] notation. If you have a literal name, you can use dot notation this.$.some_id . If

Polymer automatic node finding with dynamic id value

雨燕双飞 提交于 2019-12-28 05:53:29
问题 How can I access node that have dynamic id value using Polymer node finding by id? For example <template> <div id="{{ id }}"></div> </template> and in js Polymer("my-element", { ready: function() { if (!this.id) { this.id = 'id' + (new Date()).getTime(); } console.log(this.$.id); // this part needs to find my div element } }); 回答1: It's true that a JavaScript hash can be accessed using either dot . or array [] notation. If you have a literal name, you can use dot notation this.$.some_id . If

Polymer global variables

拈花ヽ惹草 提交于 2019-12-28 02:50:07
问题 I'm working on a Polymer app, which is pulling data from a RESTful API and using it to construct the interface. A specific area I'm stuck on conceptually is the implementation of the Monostate Pattern described at http://www.polymer-project.org/docs/polymer/polymer.html#global. Effectively, I can add declarative attributes into a new component, app-globals, and then access this reasonably straightforwardly. Here's the key question: if I'm pulling (and, potentially, resubmitting) data back and

Polymer 1.0 observers watching a object path is not triggering even though data has changed

妖精的绣舞 提交于 2019-12-25 14:24:50
问题 jsFiddle: https://jsfiddle.net/ghstahl/09tL1ku7/ <script src="https://cdn.rawgit.com/download/polymer-cdn/1.1.3/lib/webcomponentsjs/webcomponents-lite.js"></script> <link rel="import" href="https://cdn.rawgit.com/download/polymer-cdn/1.1.3/lib/polymer/polymer.html"> <link rel="import" href="https://cdn.rawgit.com/download/polymer-cdn/1.1.3/lib/paper-styles/paper-styles.html"> <link rel="import" href="https://cdn.rawgit.com/download/polymer-cdn/1.1.3/lib/paper-styles/color.html"> <link rel=

Polymer Iron-Ajax Get Method retrieving result from an expressJS route returning res.json

三世轮回 提交于 2019-12-25 09:26:54
问题 My api end point which running on Heroku free account(expressJS) url IS HERE It shows json response from an expressJS route. The data looks like this [{"_id":"5938b81bd263a5144c9d7d17","title":"mlab first entry","__v":0}, {"_id":"5939efc7fac2b71aac4add11","title":"Second Entry","__v":0}, {"_id":"5939efd0fac2b71aac4add12","title":"Second Entry","__v":0}] My polymer code which I run from localhost(http://127.0.0.1:8081/view1):` <!-- @license Copyright (c) 2016 The Polymer Project Authors. All

access DOM in polymer

眉间皱痕 提交于 2019-12-25 09:01:15
问题 What I want to achieve: highlight some text in p element (not add/ or remove) paper-badge when value is 0 change paper-badge color depending on number Sample module to play with: <link rel="import" href="https://polygit2.appspot.com/components/polymer/polymer.html"> <link rel="import" href="https://polygit2.appspot.com/components/iron-icons/communication-icons.html"> <link rel="import" href="https://polygit2.appspot.com/components/paper-icon-button/paper-icon-button.html"> <link rel="import"

How to pass a component to a component in Polymer

倾然丶 夕夏残阳落幕 提交于 2019-12-25 08:34:39
问题 Suppose a component is composed of 3 internal components, where <outer-tag> 's shadow DOM looks something like this: <div> <h1>The Outer Tag</h1> <my-tag1/> <my-tag2/> <my-tag3/> </div> Now let's say that <outer-tag> , <my-tag1/> and <my-tag3/> were always the same. But I want <my-tag2> to be pluggable. i.e. passed in. How would I do that in Polymer? 回答1: If I understood the question right, you are looking for a way to distribute random children into the outer-tag's DOM (Documentation). Here

Polymer dom-repeat error parsing the array inside the object

╄→гoц情女王★ 提交于 2019-12-25 08:19:38
问题 Trying to fiddle with Polymer framework for my small project. Polymer dom-repeat error parsing the array inside the object Following is the code invocation <paper-tabs scrollable selected={{selected}}> <template is="dom-repeat" items="{{rooms}}"> <paper-tab>{{item.name}}</paper-tab> </template> </paper-tabs> <iron-pages selected="{{selected}}"> <template is="dom-repeat" items="{{rooms}}"> <div> <port-config room-config="{{item}}"></port-config> </div> </template> </iron-pages> </template>