Questions tagged [polymer]

The Polymer library provides a set of features that make it easy and fast to make custom elements that work like standard DOM elements.

Polymer is an open source project led by the Google team. Its purpose is to implement the set of W3C specifications dealing with web components into an open source library and architecture suitable for creating and enabling reusable widgets (called web components) in modern web applications.


Example code

Simple Example:

<link rel="import" href="bower_components/polymer/polymer.html">

<dom-module id="my-tag">

  <template>
    <style>
      /* CSS rules for your element */
    </style>
    <!-- local DOM for your element -->
    <p>This is my custom Tag</p>
  </template>

  <script>
    // element registration
    Polymer({
      is: 'my-tag'
    });
  </script>
</dom-module>

Using it in another document:

<!-- Add the <link> tag in the head of your markup -->
<link rel="import" href="bower_components/my-tag/my-tag.html">

<!-- Use your new tag anywhere in the document, which
     as you expect results in "This is my custom Tag" -->
<my-tag></my-tag>

Useful resources:

8272 questions
2
votes
2 answers

Iron-ajax url with String from parent element doesn't work

In my Polymer app, I want to read a JSON file, for this I use an element. Part of the url is send by the parent element of the element currently using this . My String is properly recovered, i tried to just display it and it return exactly what I…
Rhohen
  • 35
  • 5
2
votes
2 answers

Creating a group of paper-checkbox (using iron-selector?)

My goal is to group a set of paper-checkbox. For paper-ratio-button, I am doing: Foo
Steren
  • 7,311
  • 3
  • 31
  • 51
2
votes
1 answer

Polymer: Gulp build transpile + bundle

I'm struggling to get a working custom build for Polymer using gulp. My goal is to get a Polymer 1 project written in es6 transpiled & bundled. I followed this guide https://github.com/PolymerElements/generator-polymer-init-custom-build. The…
2
votes
0 answers

polymer serve with components

I have been facing issues with the polymer-cli since I installed it. I am not able to serve components during development. I have to write my own Node.js server with remapping urls to work with components. But the documentation page clearly suggests…
ryanafrish7
  • 3,222
  • 5
  • 20
  • 35
2
votes
1 answer

How to use d3 v4 with Polymer 2.0 classes?

How can d3.js (v4) be used with a Polymer 2.0 element? Or how to use a library inside a class that already extends another class? Trying to create a polymer d3 element to take advantage of polymer's two-way data binding and d3's syntax and…
Cliff Coulter
  • 402
  • 7
  • 20
2
votes
1 answer

app-header doesn't hide Polymer 2.0

I've got a problem since I migrate to Polymer 2.0, my app-header doesn't want to hide but for exemple app-drawer does with the same attribute value. Here is my code:
jean-max
  • 1,640
  • 1
  • 18
  • 33
2
votes
0 answers

How to configure excludes for polymer-build

When using PolymerProject via PolymerBuild to configure and build a website, I would like the ability to exclude certain Javascript files from being inlined. Previously in gulp-vulcanize this had been accomplished via adding the file path to the…
2
votes
1 answer

async / await with Polymer 2.0

can we use async / await with Polymer 2.0 ? https://developers.google.com/web/fundamentals/getting-started/primers/async-functions , As soon as I use it in my code it throws errors on hydrolysis / analysis. Any sample code will be helpful too if…
Sowmyan Soman
  • 853
  • 1
  • 9
  • 21
2
votes
1 answer

Polymer - Make the parent element wait until child element completes execution

I have a element called parent-element with a property called name. parent-element has a child element called child-element. Both have a two way bound property called name Adding a code snippet to explain what I told above
RandomWanderer
  • 701
  • 2
  • 12
  • 23
2
votes
1 answer

How to choose a browser version in web component tester?

Does wct config allow for choosing a specific version of Chrome, like Chrome 34? It seems to install chrome at the beginning every time I run wtc.
Bobby Battista
  • 1,985
  • 2
  • 17
  • 27
2
votes
1 answer

Increment the value of all elements in a JSON array and display it using Polymer components

I have a JSON file (containing an integer array) to which a I send a request and retrieve the response. I want to process the response (an the integer array) and increment all the values in the integer array by one on a…
2
votes
2 answers

Polymer feed value into second dom-repeat

I'm trying to use a dom-repeat inside a dom-repeat over a json array inside a json array. How can pass a value from the first array over to the second dom-repeat? To illustrate, I have the following json array which loads fine: "books": [ { …
Vims
  • 157
  • 1
  • 8
2
votes
1 answer

Polymer web component testing: How to import dummy test data from a local .json file

I'd like to set a variable full of dummy data for use in testing. In my-element_test.html how can I do this? In an actual element, I would use iron-ajax with a local file for the url and just use the last-response variable around my code. Do I need…
Bobby Battista
  • 1,985
  • 2
  • 17
  • 27
2
votes
0 answers

iron-list data binding won't update when array is changed

I have an array of objects one-way bound in an (e.g. [[myArray]]). I update the array with a totally new version of the array via this.set("myArray", items). My issue is that the still shows the original array values. I know…
FrinkO
  • 41
  • 3
2
votes
0 answers

Generating Polymer documentation

I am trying to create a Polymer element repository, where all of the elements will have proper documentation and demo pages. My main source of knowledge is the official Document your elements page. It covers all regarding writing the docs and how to…
alesc
  • 2,776
  • 3
  • 27
  • 45
1 2 3
99
100