Can I use Polymer on a JSFiddle?

I want to create quick prototypes of Polymer elements in a sandbox, such as JSFiddle or JavaScript Bin, but I can't get it to work!

+7
javascript polymer jsfiddle jsbin
source share
1 answer

Yes you can, thanks to polygit .

Here is an example template that you can fork: https://jsfiddle.net/kaycebasques/2q3fqehz/

HTML:

<base href="https://polygit.org/components/"> <script src="webcomponentsjs/webcomponents-lite.min.js"></script> <link href="polymer/polymer.html" rel="import"> <dom-module id="x-example"> <template> <style> :host { display: block; } </style> <h1>polyfiddle</h1> </template> </dom-module> <x-example></x-example> 

JS:

 // only need this when in the main document and on non-Chrome addEventListener('WebComponentsReady', function() { Polymer({ is: 'x-example' }); }); 
+10
source share

All Articles