polymer

Polymer core-ajax won't post JSON?

空扰寡人 提交于 2019-12-05 17:36:23
I'm using core-ajax to retrieve JSON data just fine. Turning the component around to post back to the server as JSON is another thing altogether. In all cases, and irrespective of the contentType or handleAs parameters passed in, it appears that my JSON object I'm passing in as an input is being converted back to key=value in the server headers. The code: var ajax = document.querySelector('core-ajax'); ajax.method = 'POST'; ajax.handleAs = 'JSON'; ajax.contentType = 'application/json'; ajax.params = JSON.stringify(data); ajax.go(); Really straightforward. The logs in Go give me: 2014/07/22 14

Polymer core scaffold coloring and paper button

戏子无情 提交于 2019-12-05 16:56:24
问题 I'm starting to use the polymer 0.5 code to build a responsive website. I know it's not fully finished, but nevertheless I find it pretty neat and simple to get stuff done quickly. Now, I'm using the core-scaffold as general layout. I know how to color the sidebar, but I'm not sure where I can style the main content settings. <html> <head> <style> html,body { height: 100%; margin: 0; background-color: #E5E5E5; font-family: 'RobotoDraft', sans-serif; } core-toolbar { background: #E5E5E5; color

Is there the a way to prevent HTML escaping inside a Polymer expression? [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-12-05 15:45:00
This question already has an answer here : How can I bind a text which contains url as html (1 answer) Closed 5 years ago . My colleague Patrick & I currently converting an autocomplete component from Web UI to Polymer.dart.In Web UI we provided a HTML rendered list to the autocomplete in order to give a programmer the opportunity to style the results. Based on the input's value we filtered the list and displayed the matching results. What would you recommend to achieve the same behaviour in Polymer.dart? Should we approach this completly differently? Old Web UI code: <template iterate="entry

Polymer HTML Import caching

霸气de小男生 提交于 2019-12-05 14:36:43
I want to make sure that the browser gets the latest version of my custom elements via HMLT import. Right now, I am attaching a version query string: e.g. <link rel="import" href="/dist/elements/my-element.html?v=12345"> This is a common practice for JS and CSS files, and I am wondering if this is valid approach for HTML Imports as well? Jeff Posnick Yes, the same principles apply. As an example, take a look at the source of http://www.polymer-project.org/ . At the time of this writing, it contains <link rel="import" href="http://www.polymer-project.org/elements/homepage_elements.vulcanized

Polymer dom-repeat how to notify array updated

自古美人都是妖i 提交于 2019-12-05 14:16:43
So I have this Polymer element with dom-repeat. It binds correctly. However, when the array is modified, it doesn't reflect back to DOM. Nothing changed when I click on the button. <dom-module id="my-element"> <template> <template is="dom-repeat" id="allRules" items="{{allRules}}"> <span class="tag" rule-enabled$={{item.enabled}}>{{item.name}}</span> </template> <button on-click="click">Click me</button> </template> </dom-module> <script> Polymer({ is: "my-element", properties: { allRules: { type: Array, notify: true } }, click: function() { this.allRules[0].name = "three"; }, ready: function(

Accessing the parent context of a web component being either DOM or Shadow DOM

喜你入骨 提交于 2019-12-05 14:05:36
Context: I am carrying out tests about web component composition in different contexts. Particularly I am trying to relate several web component by getting access to one of them from another one by a searching process within the DOM / Shadow DOM of the involved components. Problem: Let's suppose we have a web component named x-foo requiring to access another one x-randgen . The latter component exposes business methods used by the former. In order to avoid a tightly coupled communication between both components I would like to use a discovery mechanism in x-foo to access x-randgen through a

Iron-ajax Data binding

北城余情 提交于 2019-12-05 12:56:22
How to data bind in the new Polymer v1.0? I saw an answer in polymer iron-ajax : How to Bind data from input element to iron-ajax's body attribute But it did not help me and Here is my code <dom-element id="test-app> <template> ... <iron-ajax auto url="https://www.googleapis.com/youtube/v3/search" params="{{ajaxParams}}" handleAs="json" lastResponse="{{response}}" method='GET'> </iron-ajax> </template> </dom-module> Script Polymer({ is:"Test-app", properties: { qry: { type: String, value: 'Cat' }, key1: { type: String, value: 'myapikey' }, part1: { type: String, value: 'snippet' }, maxResults1

Changing Polymer paper elements default font

落花浮王杯 提交于 2019-12-05 12:18:25
问题 What is the best way to change Polymer Paper Elements default font from Roboto to a custom font? I used the --paper-font-common-base: {} mixin to define my font and this works in most places... but not all. In places like the paper-toolbar for example there is still Roboto applied. Is there another way to do this? EDIT I see the offender now. Inside paper-styles/typography.html there are loads of mixins that specifically define the font... eg --paper-font-title: { /* @apply(--paper-font

polymer dart vs polymer js: does it matter when using the component?

和自甴很熟 提交于 2019-12-05 12:15:10
I want to build a polymer component. I can build it using Javascript. I can build it using Dart. For the person using it (me, someone else), does it make a difference or is the polymer packaging hiding all the magic inside? When you build it in JavaScript you should be able to use it in Dart. There are some problems and it might need some manual tweaking to make it work. This is work in progress and will become easier soon (for example bower support for Darts pub ). There is a package that helps generating a wrapper for Polymer.js elements to be easily used in Dart https://pub.dartlang.org

How to use react inside a polymer component?

女生的网名这么多〃 提交于 2019-12-05 11:57:53
It seems it could posible to use react inside a polymer web component but I couldn’t find a working example, only this , but it seems outdated. HTML <link rel="import" href="http://www.polymer-project.org/components/polymer/polymer.html" /> <polymer-element name="my-polymer" constructor="" attributes="name"> <template> <P>I AM {{name}}</P> <div id="reactContainer"></div> </template> <script type="text/jsx"> /** @jsx React.DOM **/ Polymer('my-polymer', { created: function(){}, ready: function(){}, attached: function(){}, domReady: function(){ React.renderComponent(<MyReact name="REACT INSIDE