Jake Moritz
Jake Moritz

Reputation: 873

Unable to test Polymer elements in HTML

I'm brand new to Polymer and have just begun messing around with it the other days. I've put together some basic site with Polymer elements but I haven't been able to find a way to properly test the site before publishing. I'm only using HTML, CSS, JavaScript, and Polymer components with Bower. When I open my HTML file in browser (file://), the Polymer elements are unrendered. The only way I've found to effectively test it was actually publishing the files, which is clearly not the best idea. I've looked into a testing server but I've only seen ones that are using PHP, MySQL, etc and couldn't set up one that works for my case. I've searched around the internet for a while and couldn't find anything that worked for me. Thank you for any help.

Upvotes: 0

Views: 116

Answers (2)

Palak Bhansali
Palak Bhansali

Reputation: 731

http-server could be the best start. Also have a look on this Angularjs Tutorial. Awesome for newbies for client side apps.

Upvotes: 1

robdodson
robdodson

Reputation: 6786

The HTML Imports polyfill uses XHR to load your components. For this reason, you need to run your app on a local server to test. You can do this in many ways: setup Apache, run a node server, or python -m SimpleHTTPServer (if you have python installed)

Upvotes: 1

Related Questions