使用 Polygit.org 聚合物元素时出错
Error using Polygit.org Polymer elements
我在使用 Polymer CDN (Polygit.org) 时遇到以下错误:
https://polygit.org/components/promise-polyfill/promise-polyfill-lite.html 加载资源失败:服务器响应状态为 404 ()
我的头标签如下:
<base href="https://polygit.org/components/" />
<script src="webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="polymer/polymer.html">
<link rel="import" href="promise-polyfill/promise-polyfill-lite.html">
<link rel="import" href="iron-ajax/iron-ajax.html">
<link rel="import" href="iron-image/iron-image.html">
<link rel="import" href="paper-styles/demo-pages.html">
这是因为 polygit.org 将 taylorhakes/promise-polyfill
and not the fork maintained by PolymerLabs
作为其 promise-polyfill
的组成部分。
这可以通过比较 polygit.org/components/promise-polyfill/bower.json
manifest to the one found in the taylorhakes/promise-polyfill
存储库来验证。
如 danielx 所述,您必须包含来自 PolymerLabs 的 promise-polyfill
。
以下行将告诉 polygit 从 github 的 polymerlabs 组织中提取 promise-polyfill
的最新版本:
<link href="https://polygit.org/promise-polyfill+polymerlabs+*/components/"
rel="import">
我在使用 Polymer CDN (Polygit.org) 时遇到以下错误:
https://polygit.org/components/promise-polyfill/promise-polyfill-lite.html 加载资源失败:服务器响应状态为 404 ()
我的头标签如下:
<base href="https://polygit.org/components/" />
<script src="webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="polymer/polymer.html">
<link rel="import" href="promise-polyfill/promise-polyfill-lite.html">
<link rel="import" href="iron-ajax/iron-ajax.html">
<link rel="import" href="iron-image/iron-image.html">
<link rel="import" href="paper-styles/demo-pages.html">
这是因为 polygit.org 将 taylorhakes/promise-polyfill
and not the fork maintained by PolymerLabs
作为其 promise-polyfill
的组成部分。
这可以通过比较 polygit.org/components/promise-polyfill/bower.json
manifest to the one found in the taylorhakes/promise-polyfill
存储库来验证。
如 danielx 所述,您必须包含来自 PolymerLabs 的 promise-polyfill
。
以下行将告诉 polygit 从 github 的 polymerlabs 组织中提取 promise-polyfill
的最新版本:
<link href="https://polygit.org/promise-polyfill+polymerlabs+*/components/"
rel="import">