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
1 answer

Polymer - get an element from parent

I have an app that will log in with firebase. I'm using polymerfire for this. Got an main app element: my-app that has these children:
microo8
  • 3,568
  • 5
  • 37
  • 67
2
votes
1 answer

CORS Authorization polymer and goapp golang

I have polymer frontend which interact with goapp server. Everything works fine as long as I do not pass authorization token in header. Here is the code at Polymer side
Dheeraj Sarwaiya
  • 163
  • 1
  • 12
2
votes
1 answer

Manually destroy and reset element?

Polymer 1.* I have a custom element that has a form. In addition, there is a few event listeners and custom handlers that I have states for in different parts of the form. When a user submits the form, I can just do reset() on the form. But this…
dman
  • 10,406
  • 18
  • 102
  • 201
2
votes
1 answer

Putting the same content in two html tags

Is there a way (and if it is possible, what's the right way to do it) to put the same DOM element in two different locations in the document? It seems like it should be possible using tags. My imagined use-case is to put two copies of the…
phsyron
  • 520
  • 3
  • 17
2
votes
1 answer

Polymer build not to create bundled and unbundled folder

I don't know why polymer build not create bundled and unbundled folders without giving any errors. info: Clearing build/ directory... info: (default) Building... info: (default) Build complete! polymer.json { "entrypoint": "index.html", …
PPShein
  • 13,309
  • 42
  • 142
  • 227
2
votes
1 answer

Polymer: How to store REST API base URL in configuration file

I'm using polymer starter kit.I have to make many API calls in different HTML pages and for each API call, I'm using "iron-ajax" in that for 'url' property I'm assigning REST API URL. URL will be like "https://XXXXX.in/YY/YY/YY" ,Here base URL …
ksh
  • 639
  • 1
  • 7
  • 23
2
votes
1 answer

Are Polymer and X-tag frontend frameworks compatible with a Content Management System ?

I would like to use a Java EE portlet based portal builder as uPortal or Liferay to deploy a web portal. Moreover, I have seen some new Frontend Frameworks (Polymer/X-tag) which seem to be really powerful and full of promises. So I wanted to know…
2
votes
3 answers

Polymer 2.0 dom-if based on function output

Relative Polymer newbie here but not new to JS. Would like to understand why the following code snip does not work. In short, I would have a user object which will be populated after the page has already loaded. A property of that object is roles…
Carl
  • 23
  • 1
  • 5
2
votes
1 answer

How to install Polymer 2.0 elements?

Because the Polymer-2.0 is in preview stage, it is not in main branch. I am looking for installation procedure for Polymer-2.0 elements. I would use bower install iron-pages to install the Polymer 1.x component. So what should I do with the 2.0…
ryanafrish7
  • 3,222
  • 5
  • 20
  • 35
2
votes
0 answers

Loading 50.000 items in a table creates unexpected timeline results

I'm testing the performance between Elm and Polymer by using the Chrome Timeline. I have written a table in each language/library and I'm filling this with 100, 1000, 5000, 10.000 and 50.000 items. I measured the loading, scripting and rendering…
2
votes
0 answers

Polymer Firebase: Cannot read property 'push' of undefined

I am trying to insert data to firebase in Polymer; using polymerfire. When I am clicking the button to add data nothing happening. In console this error is showing "Uncaught TypeError: Cannot read property 'push' of undefined" Here is my code:…
2
votes
1 answer

Polymer 2.0 errors

I have worked with Polymer 1.x for a while and I want to start a project from scratch with Polymer 2.0 but I get many errors. I am building a PWA as I did before, therefor I included a service worker and a manifest.json file. The errors I get are, I…
Incio
  • 355
  • 1
  • 13
2
votes
0 answers

How to block the javascript function till the Paper-Dialog is closed

When ever the user leaves a page, I try to open a paper-dialog asking for the confirmation. canLeavePage : function(){ this.$.paperDialog.open() } where canLeavePage triggers before the page is changed. But canLeavePage doesnt wait until the…
Shrikey
  • 858
  • 3
  • 11
  • 34
2
votes
2 answers

Issues in saving document using Polymerfire

I'm trying to save data into firebase database but always run into TypeError. Can't seem to find what the issue is. Here is my