3

This should be so easy but it's not working and it's driving me crazy.

I'm trying to get started with polymer and I've made my first app while following the tutorial on https://www.polymer-project.org. It worked great but now I'm doing this LevelUpTuts tutorial: https://youtu.be/wId1gMzriRE and my simple custom element with a simple h1 with Hello world! is just not showing up.

index.html:

<!doctype html>
<html>

<head>

  <title>Polymer</title>

  <script src="components/webcomponentsjs/webcomponents.js"></script>
  <link rel="import" href="hello-world.html">

</head>

<body>
  <hello-world></hello-world>
</body>

</html>

hello-world.html:

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

<polymer-element name="hello-world" noscript>
  <template>
    <h1>Hello world!</h1>
  </template>
</polymer-element>

I used a dash in the filename and element's name and I made sure webcomponents.js and polymer.js are properly linked. I'm not getting any errors in the console and I'm out of ideas! Any help would be very appreciated!

  • Which version of Polymer are you using 0.5.5 (Stable) or 0.8 (Alpha) – Adi Apr 14 '15 at 02:14
  • I was checking which versions I was using because I didn't know. I used bower to download polymer and the webcomponents. Then I had the idea to use the polymer and webcomponent files I had downloaded along with the tutorial zip from the polymer-website and it worked! I guess something is wrong with the bower files. – Brad Goyvaerts Apr 14 '15 at 15:43

1 Answers1

0

It looks like you're using the pre 1.0 syntax but the 1.0+ version of Polymer.

In Polymer 1.0+, you can create a module with <dom-module name="hello-world"> instead of <polymer-element name="hello-world">.

ermish
  • 1,160
  • 2
  • 13
  • 26