简体   繁体   English

在Meteor Angular 1.3中使用npm模块

[英]Using npm modules in Meteor Angular 1.3

This seems like a dumb question but I remain confused. 这似乎是一个愚蠢的问题,但我仍然感到困惑。 Supposedly meteor has built in support for npm modules in 1.3 . 据说meteor在1.3中内置了对npm模块的支持。

I am using Meteor with Angular integration. 我正在将Meteor与Angular集成使用。 On the tutorial it seems that using npm modules should be as simple as: 在本教程上,似乎使用npm模块应该很简单:

  1. installing the npm package into the meteor root folder 将npm软件包安装到流星根文件夹中

And

  1. importing them into the file in the form import name from 'name' . import name from 'name'中的import name from 'name'格式将它们导入文件。

This however does not seem to be working for me. 但是,这似乎不适用于我。

The reason why you can think: 您可以考虑的原因:

does not seem to be working for me 似乎不适合我

may be the fact that not all packages produce default export as MasterAM mentioned. 可能是并非并非所有软件包都像MasterAM提到的那样产生默认导出。

For packages, that do not support default export you can use: import 'name' to get your module loaded globally. 对于不支持默认导出的软件包,您可以使用: import 'name'将模块全局加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM