Don't know why Polymer is not working

user3647254

I have just started working on my first polymer web app but i can't figure out how to create a simple app in polymer. I installed polymer and web_components. And made the index.html file with the source code below

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>My First polymer web APP</title>
    <script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
    <link rel="import" href="bower_components/polymer/polymer.html">
  </head>
  <body>
<polymer-element name="x-foo" noscript>
<template>
<h1>HELLO FROM x-foo</h1>
</template>
</polymer-element>
<x-foo></x-foo>
  </body>
</html>

But it doesn't seems to work. I looked into the console and this is what i look. I think there is no problem in this:

GET 
http://localhost:3000/ [HTTP/1.1 304 Not Modified 23ms]
GET 
http://localhost:3000/bower_components/webcomponentsjs/webcomponents.min.js [HTTP/1.1 304 Not Modified 12ms]
GET 
XHR 
http://localhost:3000/bower_components/polymer/polymer.html [HTTP/1.1 304 Not Modified 3ms]
GET 
XHR 
http://localhost:3000/bower_components/polymer/polymer-mini.html [HTTP/1.1 304 Not Modified 36ms]
GET 
XHR 
http://localhost:3000/bower_components/polymer/polymer-micro.html [HTTP/1.1 304 Not Modified 2ms]
mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create

Please help as i am beginner to polymer. Thanks in advance.

Peter Burns

It looks like you're using Polymer 0.5 syntax, but you've probably got Polymer 1.0 installed.

Try this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>My First polymer web APP</title>
    <script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
    <link rel="import" href="bower_components/polymer/polymer.html">
  </head>
  <body>
<dom-module name="x-foo">
<template>
<h1>HELLO FROM x-foo</h1>
</template>
<script>
  window.addEventListener('WebComponentsReady', function() {
    Polymer({is: 'x-foo'});
  });
</script>
</dom-module>
<x-foo></x-foo>
  </body>
</html>

The window.addEvetnListener part is only necessary if you're declaring your element in the main HTML file of your application rather than in an HTML import.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

resizeBy not working and don't know why

From Dev

retina.js not working - Don't know why

From Dev

primefaces GMap example not working and don't know why

From Dev

File open prompt Function code not working - don't know why

From Dev

SourceTree Push count working differently and I don't know why

From Dev

networking stopped working and I don't know why

From Dev

Line of code not working. Don't know why?

From Dev

I don't know why this FFmpeg command is not working in android?

From Dev

Don't know why `asyncio.Lock` is not working

From Dev

Insertion operator is not working with vector and I don't know why

From Dev

New to Ruby and SQLite , don't know why my queries aren't working

From Dev

Unity: GameObject.FindGameObjectWithTag isn't working and I don't know why

From Dev

é instead of "é", definitely don't know why

From Dev

I don't know why this canvas is null

From Dev

Getting null pointer, don't know why

From Dev

Get 404 error and don't know why

From Dev

Sound is gone, I don't know why

From Dev

Getting exception ClassNotFoundException and don't know why

From Dev

é instead of "é", definitely don't know why

From Dev

title is indented and i don't know why

From Dev

SMTP Error, I don't know why

From Dev

Anyone know why compiz isn't working?

From Dev

For loops python (beginner): Don't know why this won't work

From Dev

For loop won't end. Don't know why

From Dev

Stored Procedure doesn't work and I don't know why

From Dev

I don't know why I can't use asfreq()?

From Dev

Hibernate Validator doesn't work but I don't know why

From Dev

Not sure why date-picker widget isn't working, also don't know why the id selector isn't auto filling results field

From Dev

I don't understand why Redirect() is not working

Related Related

  1. 1

    resizeBy not working and don't know why

  2. 2

    retina.js not working - Don't know why

  3. 3

    primefaces GMap example not working and don't know why

  4. 4

    File open prompt Function code not working - don't know why

  5. 5

    SourceTree Push count working differently and I don't know why

  6. 6

    networking stopped working and I don't know why

  7. 7

    Line of code not working. Don't know why?

  8. 8

    I don't know why this FFmpeg command is not working in android?

  9. 9

    Don't know why `asyncio.Lock` is not working

  10. 10

    Insertion operator is not working with vector and I don't know why

  11. 11

    New to Ruby and SQLite , don't know why my queries aren't working

  12. 12

    Unity: GameObject.FindGameObjectWithTag isn't working and I don't know why

  13. 13

    é instead of "é", definitely don't know why

  14. 14

    I don't know why this canvas is null

  15. 15

    Getting null pointer, don't know why

  16. 16

    Get 404 error and don't know why

  17. 17

    Sound is gone, I don't know why

  18. 18

    Getting exception ClassNotFoundException and don't know why

  19. 19

    é instead of "é", definitely don't know why

  20. 20

    title is indented and i don't know why

  21. 21

    SMTP Error, I don't know why

  22. 22

    Anyone know why compiz isn't working?

  23. 23

    For loops python (beginner): Don't know why this won't work

  24. 24

    For loop won't end. Don't know why

  25. 25

    Stored Procedure doesn't work and I don't know why

  26. 26

    I don't know why I can't use asfreq()?

  27. 27

    Hibernate Validator doesn't work but I don't know why

  28. 28

    Not sure why date-picker widget isn't working, also don't know why the id selector isn't auto filling results field

  29. 29

    I don't understand why Redirect() is not working

HotTag

Archive