流星应用中的聚合物元素 [英] Polymer Elements in a Meteor App

查看:66
本文介绍了流星应用中的聚合物元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人成功将聚合物元素添加到Meteor项目中?我很难让它发挥作用。

Has anyone successfully added Polymer elements to a Meteor project? I'm struggling to make it work.

我尝试使用bower在公共场所下安装Polymer软件包:

I've tried using bower to install the Polymer package under public:

├── public
│   ├── bower_components
│   │   ├── platform
│   │   └── polymer
│   ├── elements
│   │   └── my-element.html

然后包括像这样的元素:

I then included the element like this:

<head>
  <title>test</title>
  <script src="bower_components/platform/platform.js"></script>
  <link rel="import" href="elements/my-element.html">
</head>
<body>
  ...
  <my-element></my-element>
  ...
</body>

这导致对platform.js和my-element.html的XHR请求无限循环。

That's resulting in an endless loop of XHR requests for platform.js and my-element.html.

我也尝试过 meteor-polymer 软件包,不包括polymer.html,我无法让它识别包装:

I've also tried the meteor-polymer package, that doesn't include polymer.html and I couldn't get it to recognize the package anyway:

=> Errors prevented startup:

While building the application:
error: no such package: 'polymer'

我希望有人能够让Polymer与Meteor合作,因为我真的想在这款应用程序中使用我的组件。

I'm hoping someone has been able to get Polymer working with Meteor as I'd really like to use my components in this app.

推荐答案

我创建了一个包,用于向Meteor添加Polymer功能。

I have created a package to add Polymer functionality to Meteor.

这是github。

http://github.com/ecwyne/meteor-polymer

更新:
也可以使用添加meteor add ecwyne:polymer-elements

这篇关于流星应用中的聚合物元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆