Rahul A.kumar
Rahul A.kumar

Reputation: 11

Polymer 1.0 not working

I am trying to make a simple 'Hello World!' element. I have tried installing the polymer components with bower and I have used the zip file. I have also use python and npm HTTP server but still I don't get any output. <html> <head> <title>Polymer</title> <script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script> <link rel="import" href="elements/hello-world.html"> </head> <body unresolved> <hello-world></hello-world> </body> </html>

with the element file <link rel="import" href="../bower_components/polymer/polymer-mini.html"> <polymer-element name="hello-world" noscript> <template> <h1>Hello World!</h1> </template> </polymer-element>

Upvotes: 1

Views: 315

Answers (1)

wirlez
wirlez

Reputation: 388

You are using the wrong API for the polymer-element. You should be using the <dom-module> like Trevor Dixon mentioned.

See Plunker

<link rel="import" href="../bower_components/polymer/polymer-mini.html">

<dom-module id="hello-world">
    <template>
    <h1>Hello World!</h1>
    </template>
</dom-module>

<script>
Polymer({
  is: 'hello-world'
})
</script>

Upvotes: 7

Related Questions