polymer-1.0

Polymer 1.0 paper-radio-group selection - how to get selected item

雨燕双飞 提交于 2019-12-12 02:45:58
问题 I have tried this solution but seems like it is doing nothing for me. I have Polymer 1.0. Only change I made from the solution is to put the observers inside data property and made is "not protected". I got this idea from here. Initially I used the exact approach as in Ricky's solution but that didn't work for me either. Here is how my custom element looks like: <dom-module id="radio-group-binder"> <template> <paper-radio-group class="layout vertical" selected-item="[[selectedItem]]">

Polymer: can't get this.__data__ passing in from host

*爱你&永不变心* 提交于 2019-12-12 02:20:56
问题 I have a very simple project: app/ parent.html child.html index.html I try to pass data from parent to child and then get them within Polymer(): index.html <!DOCTYPE html> <html> <head> <link rel="import" href="bower_components/polymer/polymer.html"> <link rel="import" href="app/parent.html"/> </head> <body> <h1>Hello Paul!</h1> <x-comphost></x-comphost> </body> </html> app/parent.html <link rel="import" href="child.html"/> <dom-module id="x-comphost" noscript> <template> <h4>Hello, man!</h4>

Polymer paper-dropdown-menu

最后都变了- 提交于 2019-12-11 20:11:22
问题 I am trying with paper-dropdown-menu . It seems to be working on Google Chrome but on Firefox the dropdown menu is not coming up. Is this only compatible with Chrome browser? 回答1: <link rel="import" href="../../bower_components/polymer/polymer.html"> <dom-module id="cc-dropdown"> <template> {{selectedData}} <paper-dropdown-menu label="Environment"> <paper-menu class="dropdown-content" attr-for-selected="value" selected="{{selectedData}}"> <template is="dom-repeat" items="{{data}}"> <paper

Polymer 1.0 paper-input text highlighting

人盡茶涼 提交于 2019-12-11 19:24:29
问题 I have just been testing some polymer 1.0 elements. I noticed that using the paper-input element it is not possible to drag highlight text entered into it. It is possible to use keyboard shortcuts to highlight text and it is also possible to double click. I have checked the documentation and i cannot see if this is intended functionality, can anyone shed any light? 回答1: This seems to be fixed in the recent update to iron-input or paper-input. It works fine in the demo now. https://elements

Polymer 1.0 Node.bind() - Can I create a binding via javascript instead of double braces?

筅森魡賤 提交于 2019-12-11 16:30:36
问题 Is there a way in Polymer 1.0 to set up a binding using javascript like Node.bind() did previously? [Ignore this: Apparently being succinct is not allowed in stackoverflow so I have to write this useless sentence in order to post the question.] 回答1: Short answer is: NO . Polymer 1.0 currently does not support imperative data-binding. In 1.0, the data-binding mechanism was completely rewrote, so previous 0.5-ish techniques like Node.bind('content', new PathObserver(obj, 'path.to.value')); or

Databinding in Polymer

送分小仙女□ 提交于 2019-12-11 16:17:17
问题 My Goal I want to databind the items property shown in this jsBin -- and have the rendered HTML text output match the value shown in the console. What I expect to see... When I open this jsBin, in the right pane labeled output , I expect to see the following in the second line of text: Lorem,Ipsum,foo,1,bar,1,baz,0,qux,0 What I actually see... Instead, I see: Lorem,Ipsum,foo,0,bar,0,baz,0,qux,0 But if you click the button labeled Show , and check the console, you will see the following:

Data binding in Polymer - function is being removed from bound object

淺唱寂寞╮ 提交于 2019-12-11 13:57:53
问题 I'm encountering an issue binding an object that contains a function from angular to Polymer 1.0. The function is not being passed through into the target object in the custom element. Here is a simplified code sample: The custom element has a single property named myprop: <script> Polymer({ is: 'my-custom-element', properties: { myprop: Object }, attached: function () { var x = this.myprop.x; //this is ok this.myprop.myfunc(); //myfunc is not defined! } }); </script> Here is the HTML: <div

Routing in polymer 1.0

你离开我真会死。 提交于 2019-12-11 13:41:40
问题 I am new to web development and building an application using polymer 1.0.4. I am using the page.js routing similar to the example in start kit. Now many of the custom element that I built are using ajax and periodically refresh the data. The problem with page.js routing that It seems it loads all custom elements even if the element is not viewed by user. so all custom elements are loading the data even if it is not needed. my questions: 1- How could I fix this so the the elements load data

How to access details of a swiped paper-card in iron-swipeable-container

不问归期 提交于 2019-12-11 13:29:40
问题 I have a swipeable-container with a dom-repeat (firebase data) <iron-swipeable-container id="teamchat"> <template is="dom-repeat" items="[[tcmmessages]]" as="tcmmessage"> <paper-card id="tcmcard" class="swipe item blue" data-index$="[[tcmmessage.__firebaseKey__]]"> <div class="card-content"> <b>[[tcmmessage.teamname]]</b> <paper-icon-button style="color: red;" on-tap="_startChat" icon="communication:chat"></paper-icon-button><br> [[tcmmessage.beitrag]]<br> <span class="chatmetadata">von [

Polymer, paper-datatable styling of rows

蓝咒 提交于 2019-12-11 13:25:42
问题 I'm trying to colour the rows of paper-datatable using the attribute customRowStyle This Plunk of paper-datatable is working, rows are colored, but it's not enclosed as separate Polymer element. I need to enclose paper-datatable in separate element. Need some help to fix this: how to make customRowStyle(item) to get called on table render and pass the item ? <paper-datatable data="{{data}}" custom-row-style="{{generateRowCss}}" on-row-tap="row_tap"> <paper-datatable-column header="title"