polymer

Polymer camelCase attributes

风格不统一 提交于 2019-12-24 20:49:43
问题 I'm writing a wrapper around a js library with Polymer components. Basically, I need to be able to assign attributes to a component, and forward them to an instance of a js object. The problem is that Polymer (or webcomponents in general?) forces attribute names to be lowercase. Declaring the element <some-element fooBar="baz"></some-element> Generic change listener attributeChanged: function(attrName, oldVal, newVal){ // attrName -> foobar, which is not a member of someInstance this

POST JSON with iron-ajax to SQL Server with Node

孤人 提交于 2019-12-24 20:20:12
问题 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 trigger Polymer paper ripple animation by API code?

懵懂的女人 提交于 2019-12-24 17:42:51
问题 I tried $.find("paper-ripple").animate(); described at https://elements.polymer-project.org/elements/paper-ripple but this does not work. 回答1: You can use simulatedRipple() method of paper-ripple. <!DOCTYPE html> <html> <head> <base href="https://polygit.org"> <script src="/components/webcomponentsjs/webcomponents-lite.min.js"></script> <link rel="import" href="/components/polymer/polymer.html"> <link rel="import" href="/components/paper-ripple/paper-ripple.html"> <style> .card { position:

Polymer 1.0: Data binding variable to <iron-meta> element (value attribute)

我的梦境 提交于 2019-12-24 17:28:25
问题 In Polymer 1.0, I am trying to data bind a string variable {{str}} to an <iron-meta> element (tag in parent element) as follows. This fails: <iron-meta id="meta" key="info" value="{{str}}"></iron-meta> The above code breaks. But the following code works (without the binding). This works: <iron-meta id="meta" key="info" value="foo/bar"></iron-meta> The difference is the variable version {{str}} fails and the constant version "foo/bar" works. Does anyone have a clue what is what is breaking the

What is the best way to communicate and pass data between child polymer elements?

别说谁变了你拦得住时间么 提交于 2019-12-24 16:18:05
问题 I have a parent polymer element baseline-policies-tab . This, on the UI, represents a tab on my website. In this tab, I have two polymer elements. One is baseline-policies-create which is a polymer element with a button. When this button is pressed, I want to send an event to another child polymer element that is contained within the tab, baseline-policy-ajax . This element will send an ajax request. I've tried dispatchEvent by sending a CustomEvent but it didn't work for me (here is the

How can I swipe between tabs using Polymer 1.0?

随声附和 提交于 2019-12-24 16:12:16
问题 I am using Polymer 1.0 and looking to create a tabbed layout where I can swipe between each tab I have. I have found a swipe-pages component, but the dependencies on the site state that it needs "polymer": "Polymer/polymer#^0.4.0" which does not work with the rest of my application. Are there any other components compatible with the latest version of Polymer (or at least Polymer 1.0)? Thanks 回答1: There is a Polymer 1.0 version. See https://github.com/slogger/swipe-pages. 回答2: I'm very new in

Binding to global variables in Polymer

 ̄綄美尐妖づ 提交于 2019-12-24 15:25:26
问题 I am fairly new to Polymer, and only just studied how data binding works. I am porting an existing Dojo application, where there would be: 1) A single store (holding data) for each URL 2) A message from the server when a store element was updated As a result, a dynamically made select box which depended on data in the store would automagically have an extra item if anywhere in the application a user added an item to the store (which held the data) I am trying to replicate something like this

Does Polymer work in PHP files?

你离开我真会死。 提交于 2019-12-24 13:03:47
问题 If I wanted to use Polymer in a PHP project - could I just use the elements in my PHP file, or should I simply be using post core-ajax and posts to handle the backend and leave files as HTML? I haven't found a lot of documentation about it. Thanks! 回答1: yes it can work. but if using php you could just feed back json to a polymer app in html by using json_encode on your php array of other output. the way polymer loads all the data on the initial load it would make app loading longer cause php

Use polymer expression on main html site

ぐ巨炮叔叔 提交于 2019-12-24 12:33:40
问题 short question: Is it possible to use polymer expressions on a normal html site? So that I could write {{ 1+ 1 }} somewhere and it would be evaluated to 2. 回答1: If you mean "without including anything of polymer", than the short answer would be "no". Otherwise here is an example for using a polymer expression outside of a polymer element: <!doctype html> <html> <head> <script src="/components/platform/platform.js"></script> <link href="/components/polymer/polymer.html" rel="import"> </head>

Two-way data binding through property-changed does not work for dom-bind

情到浓时终转凉″ 提交于 2019-12-24 11:35:48
问题 I'm trying to make Polymer's two-way data binding work with my native custom elements within auto-binding dom-bind . I follow the docs which says: When using a Polymer element with other elements or frameworks, you can manually attach an on-property-changed listener to an element to be notified of property changes, and take the necessary actions based on the new value. So I created an element, and attached binding to it: <my-element notify="{{text}}"></my-element> Then, to follow notification