polymer

Polymer Template: What are valid selects for content insertion points

与世无争的帅哥 提交于 2020-01-14 09:12:22
问题 This may be fairly simple question, and though I can find some simple examples, I cannot find documentation on this on the Polymer Project website. In the template for an element, you may use: <content select="value"></content> My question is what are valid values for the select attribute. Is it simply an element? Can it be any simple CSS selector (such as "#id" )? Can it be a bound value ( "{{data}}" )? While, ultimately, I'm just looking for the answer, I would also gladly accept a document

What's the difference between this.$ and this.$$ in Polymer?

回眸只為那壹抹淺笑 提交于 2020-01-14 07:40:09
问题 I've read the documentation over and over and have googled with no luck. The docs start explaining this.$ with an example but then they don't give an example for what this.$$ does As far as I understand it, this.$ will find something in my template with the ID I want. For example - I can use this.$.test.textContent="hey there" But for this.$$ it just says "dynamically-created nodes" - maybe someone can explain with an example what the difference between static and dynamic created nodes is,

How to update dependencies of one Polymer component without updating those of another?

流过昼夜 提交于 2020-01-14 04:18:09
问题 I'll try to describe our specific problem to avoid running into an XY Problem. We have one Polymer app, that consists of several independent components (maintained by different teams). Each of these components has dependencies on other components, managed by Bower. Sometimes, different components (say, A and B) have dependencies on the same components (e.g. C). Now when C releases a new version with a breaking change, both A and B have to upgrade to that new version at the same time . This

Polymer - Updating Element

笑着哭i 提交于 2020-01-14 01:46:14
问题 I'm learning Polymer. One item that is challenging me is updating the item of an array. I wish there was a CDN for Polymer so I could put together a fiddle. For now though, I have an element defined like this: my-element.html <dom-module id="my-element"> <button on-click="onLoadData">Load Data</button> <button on-click="onTest1Click">Test 1</button> <button on-click="onTest2Click">Test 2</button> <template is="dom-repeat" items="[[ data ]]" as="element"> <div><span>[[ element.id ]]</span> -

Handling polymer elements with different heights inside <core-pages>

自作多情 提交于 2020-01-13 16:24:18
问题 I have a <core-drawer-panel> and inside it is a <core-pages> element inside <core-header-panel main> . <core-pages> contains a set of custom elements that I have defined and only one of those elements are shown at any point of time. However the problem is, there are elements that take only part of the screen but still scroll vertically. The amount of scrolling is equal to the tallest element within <core-pages> . The expected behavior is that the element should scroll only if it exceeds it's

polymer 1.0 how to central justify the paper-card heading?

六眼飞鱼酱① 提交于 2020-01-13 06:33:25
问题 I am trying this to central justify the paper card heading: paper-card [heading]{ @apply(--center-justified); } but it does not seem to help. kindly suggest 回答1: heading is not an attribute so you cannot write like that. You basically need to style the .title-text element inside the shadow dom, so use this instead - paper-card::shadow #shadow .header .title-text { display: flex; justify-content: center; } Or use the polymer iron-flex-layout - paper-card::shadow #shadow .header .title-text {

Protractor: Unable select input element inside a shadow DOM (Polymer) using by.deepCss('input')

↘锁芯ラ 提交于 2020-01-13 04:31:51
问题 Environment: Angular (v5 Application with Polymer Web Components. Protractor for running e2e tests. Angular CLI: 1.6.4 Node: 6.10.0 Angular: 5.2.0 @angular/cli: 1.6.4 typescript: 2.5.3 Below given is my polymer web component shadow root expanded in chrome. You could see input type = "text" inside this custom element. I am unable to access input element inside custom polymer component using protractor by.deepCss . var polymerFirstName = element(by.className('polyFName')); var inputs =

google-chart not displaying

本小妞迷上赌 提交于 2020-01-13 03:20:09
问题 I am trying to use the polymer component but it is not displaying. The element is there. I can see it in the inspector but it just does not display. There are also no error messages which does not help. I have tried to recreate the demo.html in the polymer docs and again nothing showing. Are there issues with the goole-chart element? <dom-module id="stats-page"> <style> code { color: #007000; } google-chart { height: 300px; width: 400px; } #selection-demo { position: relative; height: 300px;

Polymer 1.0 cannot find events for paper-menu or paper-item

左心房为你撑大大i 提交于 2020-01-12 07:44:29
问题 Upgrading to Polymer 1.0, How do I listen/capture to change in "focusedItem" of iron-menu-behaviour? I cannot see any event or property change listener for an item change i.e. change in paper-item selection within a paper-menu. I cannot see any such events here: https://elements.polymer-project.org/elements/iron-menu-behavior?active=Polymer.IronMenuBehavior 回答1: I have not been able to find any documentation on this just yet (perhaps someone else may have better luck), but the events you are

How can I handle a hover the Polymer way without external libraries?

 ̄綄美尐妖づ 提交于 2020-01-12 07:18:05
问题 I figured I would need to do something like: <li on-mouseover="{{ myHoverHandler }}">blah</li> because handling clicks looks like this: <li on-click="{{ myClickHandler }}">blah</li> I've tried using the way shown in the documentation here: declarative event mapping , but on-mouseenter and on-mouseover aren't working as expected. I'm also having trouble passing parameters to my handlers, but that's a different story. 回答1: on-mouseover and on-mouseout are correct, here's a demo as a Stack