0

I have created a single page polymer app and when I run node app.js the app is not being displayed.

index.html

<!doctype html>
<html>
  <head>
    <script src="/bower_components/webcomponentsjs/webcomponents.js"/>
    <link rel="import" href="/bower_components/polymer/polymer.html">
    <link rel="import" href="/bower_components/core-icon/core-icon.html">
    <link rel="import" href="/bower_components/paper-input/paper-input-decorator.html">
    <link rel="import" href="/bower_components/paper-icon-button/paper-icon-button.html">
    <link rel="import" href="/bower_components/paper-shadow/paper-shadow.html">
    <link rel="import" href="/bower_components/paper-card/paper-card.html">
    <link rel="import" href="news-api.html">
  </head>
  <body>
    <news-api></news-api>
  </body>
</html>

news-api.html

<dom-module id="news-api">
  <template>
    <span>{{message}}</span>
  </template>

  <script>
    Polymer({
      is: 'news-api',
      properties : {
        message: {
          type: String,
          value: "Hello world!"
        }
      }
    });
  </script>
</dom-module>

I am just posting my polymer code because the node.js part seems to be working fine. Please pardon me if I have made some dumb mistakes, I am new to polymer and node.js.

Nikhil Raghavendra
  • 1,570
  • 5
  • 18
  • 25

1 Answers1

0

Found out the issue. The problem is with your self-closing script tag. Please check this link to know more about this problem. Replacing

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

with

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

should fix your problem

Community
  • 1
  • 1
a1626
  • 2,953
  • 1
  • 19
  • 34