[英]How to add correctly use Meteor package in a angular2-meteor project?
I am writing an angular2-meteor program. 我正在编写一个angular2流星程序。
When I am using urigo:angular2-meteor package, I add reference path like this: 当我使用urigo:angular2-meteor软件包时,我添加了如下引用路径:
/// <reference path="../typings/angular2-meteor.d.ts" />
The question is: can I use other normal meteor packages in a angular2-meteor project? 问题是:我可以在angular2-meteor项目中使用其他普通的流星包吗? Or I can only use some packages written for angular2-meteor specifically.
或者我只能使用一些专门为angular2-meteor编写的软件包。
For example, if I want to use yuukan:streamy , how can I use it correctly? 例如,如果我想使用yuukan:streamy ,如何正确使用它? Right now, I have one line code
现在,我有一个行代码
Streamy.broadcast('hello', {data: 'world!'});
When I compile it, it shows: Cannot find name 'Streamy'.
当我编译它时,它显示:
Cannot find name 'Streamy'.
Thanks! 谢谢!
you can use all the libraries from meteor. 您可以使用流星的所有库。
you will have 2 choices. 您将有2个选择。
declare var Streamy
at the top of the file you want to use it. declare var Streamy
。 The library is already there if you add it via atmosphere
. atmosphere
添加库,则该库已经存在。 But typescript does not know about it.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.