0

polygitでiron-ajaxを適切にインポートするにはどうすればよいですか? これにより、エラー400が発生します

    <base href="https://polygit.org/components/">
    <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
    <link href="polymer/polymer.html" rel="import">
    <link rel="import" href="iron-ajax/iron-ajax.html">
4

1 に答える 1

1

Polygitは廃止され、機能しなくなりました。<base>代わりに、デモで次の URL を使用できます。

<head>
  <base href="https://cdn.rawgit.com/download/polymer-cdn/1.8.0/lib/">
  <link rel="import" href="polymer/polymer.html">
  <script src="webcomponentsjs/webcomponents-lite.js"></script>
  <link rel="import" href="iron-ajax/iron-ajax.html">
</head>
<body>
  <x-foo></x-foo>

  <dom-module id="x-foo">
    <template>
      <div>Please wait...</div>
      <iron-ajax id="ajax"
                 auto
                 url="http://jsonplaceholder.typicode.com/users/"
                 last-response="{{data}}"
                 handleAs="json">
      </iron-ajax>
      <table>
        <template is="dom-repeat" items="[[data]]">
          <tr>
            <td>[[item.id]]</td>
            <td>[[item.name]]</td>
            <td>[[item.email]]</td>
          </tr>
        </template>
      </table>
    </template>
    <script>
      HTMLImports.whenReady(function() {
        Polymer({
          is: 'x-foo'
        });
      });
    </script>
  </dom-module>
</body>

jsbin

于 2016-05-27T13:04:36.423 に答える