Polymer is not defined

99 views Asked by At

I am trying to call a function on the click of paper-button in my polymer application. But polymer throws error there:

enter image description here

I searched for the same error I found that we should import polymer.html. I have also imported polymer.html in my index file, but still, it's failing:

enter image description here

I am not getting what I did wrong.

1

There are 1 answers

0
Justin Fagnani On

You're not loading the polyfills correctly. They are not HTML files to be loaded with HTML imports, you need to load them with a <script> tag:

<script src="bower_components/webcomponentsjs/webcomponents-loader.js"></script>

Note: HTML Imports have been removed from Chrome, so every browser requires the polyfill now. I'd switch to Polymer 3.x as soon as you can. From there you can upgrade to LitElement incrementally.