polymer

Polymer 1.x: How to imperatively (using JS) obtain the value of a custom CSS property?

℡╲_俬逩灬. 提交于 2019-12-11 06:16:45
问题 In the following example, I have a parent custom element calling a child custom element. The child has a variable color CSS property for p elements that can be defined in the parent CSS. In the JS of the child element, I want to read the --custom-color value selected at the parent. In this case, the value is yellow . Put another way: when the getCustomColor() method is run, I want the console log to read "Your custom color is yellow." What JavaScript do I put in the getCustomColor() method to

Express body-parser: Unexpected token # in JSON at position 0

半世苍凉 提交于 2019-12-11 06:09:46
问题 I am trying to return user data from a login with Polymer. I have it working with Postman, but am having trouble translating it into Polymer. In Postman this returns a JSON object, but in Polymer it is returning undefined. Polymer Client Code [Connecting to node.js server] <iron-ajax id="ajaxUser" url="http://localhost:8080/login" method="post" handle-as="json" content-type="application/json" headers='{"Access-Control-Allow-Origin": "*"}' params="[[params]]" on-response="saveUserCredentials"

how to implements addEventListener in iron form polymer

别说谁变了你拦得住时间么 提交于 2019-12-11 06:09:12
问题 How to implements addEventListener in iron form polymer? i already following this guide : iron-form and this is my code : <form is="iron-form" method="get" action="/" id="eventsDemo"> <paper-input name="name" label="Name" required auto-validate></paper-input> <paper-input name="password" label="Password" type="password" required auto-validate></paper-input> <paper-checkbox name="read" required>You must check this box</paper-checkbox><br> <paper-button raised onclick="_delayedSubmit(event)"

Iroin-ajax response with html tags [duplicate]

无人久伴 提交于 2019-12-11 06:09:01
问题 This question already has answers here : How to inject HTML into a template with polymer (3 answers) Closed 3 years ago . I'm getting a JSON feed by iron-ajax, in the returned JSON come with HTML tags like this. [{ pk :1, body: "<p>ثم سكان بشرية الأبرياء عدد, كلّ يقوم الطرفين و. وبدأت انذار عل بحق, تكبّد إستيلاء الأثناء، دنو بـ, عالمية العالم، بالمطالبة قد الى. وزارة السبب التّحول فصل بل, كل والتي واشتدّت وايرلندا بعض. إحتار واندونيسيا، بلا لم, بوابة الفترة بين بل. </p> <p>ثم سكان بشرية

Polymerfire google auth not working

落花浮王杯 提交于 2019-12-11 05:51:34
问题 I'm new to Polymer and Firebase (and as a programmer as well), I'm trying to do a simple login with Google and show the user is logged in. Google Auth is enabled in Firebase. The logout button should be hidden when there is no user logged in, but when I click the login button, nothing happens. There are no warnings in the browser's console. Here is the code that I'm using: <!DOCTYPE html> <html> <head> <link rel="import" href="bower_components/polymerfire/firebase-app.html"> <link rel="import

Polymer: Updating Templatized template when parent changes

廉价感情. 提交于 2019-12-11 05:44:13
问题 Following this question, I'm trying to get full two-way binding between parent and template when using Polymer.Templatizer. I'm not sure what the problem is _forwardParentProp and _forwardParentPath are never called when a property changes on parent. I think it's the reason why my templates don't update. Here's my code (also available here). As you can see dom-if binds both ways and the two templates (one created dynamically other declared inside custom element) only update parent but aren't

Not able to save uploaded file on server using GOLANG and POLYMER http: no such file

不羁岁月 提交于 2019-12-11 05:32:09
问题 I am using vaadin upload to upload files on web application with polymer. And I am using golang for back-end. <vaadin-upload target="../upload" max-files="20" accept="application/pdf,image/*" method="POST"> </vaadin-upload> I checked that encoding type used in vaadin upload is multipart/form-data . My golang code is below. func upload(w http.ResponseWriter, r *http.Request) { fmt.Println("method:", r.Method) if r.Method == "GET" { crutime := time.Now().Unix() h := md5.New() io.WriteString(h,

Polymer app-route query string format

柔情痞子 提交于 2019-12-11 05:29:50
问题 I replaced PageJS routing in our application with app-location and app-route , and everything seems to be working except the query parameters. I noticed it can only read URLs like host?param1=val1#/view , not host#view?param1=val1 how PageJS used to. Upon further digging, I discovered that this is actually an RFC standard. I find it odd that PageJS and Angular can use the nonstandard query string format. Is there a way to use the query-params attribute of app-route to read the nonstandard

Polymer event parameters on repeat

这一生的挚爱 提交于 2019-12-11 05:18:09
问题 I am working on Polymer and pretty new in this. I have a list which iterates using a template. There needs to be a remove button on that. On click of remove I am calling a function. How do we know which list item was called so that I can have the item to remove. <template repeat="{{ data in listData }}"> <div> <img src="../../Styles/images/edit.png" alt=""> <img src="../../Styles/images/remove.png" alt=""> </div> </template> I was doing the remove like this before <img src="../../Styles

Styling native input in Polymer 2.x?

自闭症网瘾萝莉.ら 提交于 2019-12-11 05:06:49
问题 I am trying to implement this answer. Is there any way to bind an on-click or on-tap event of a <paper-button> to either of the following hidden input elements? my-form.html <iron-form> <form> ... <my-buttons></my-buttons> ... <input hidden type="reset"> <input hidden type="submit"> </form> <iron-form> Or to trigger those events in any way? i.e., I have dispatched an event from my <paper-button> as follows my-buttons.html <paper-button on-tap="_reset">Reset</paper-button> <paper-button on-tap