将Joose与流星(或流星)一起使用的最佳方式是什么?
如果我加载joose-all.min.js,我只能让Joose工作,但这似乎不允许我使用其他Joose库(特别是JoosX-Attribute)。
我还尝试创建了一个包含在其package.js文件中的包
Npm.depends({
'joose' : '3.50.0'
});但这只会导致meteor无法启动,并显示以下错误
/home/dev/GDL/gdl-csr/meteor/.meteor/local/build/server/server.js:337
}).run();
^ ReferenceError: Joose is not defined
at app/gdl-csr.js:1:16
at /home/dev/GDL/gdl-csr/meteor/.meteor/local/build/server/server.js:298:12
at Array.forEach (native)
at Function._.each._.forEach (/home/dev/.meteor/tools/cc18dfef9e/lib/node_modules/underscore/underscore.js:78:11)
at run (/home/dev/GDL/gdl-csr/meteor/.meteor/local/build/server/server.js:239:7)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.有什么建议可以让我继续下去吗?
发布于 2013-06-25 20:07:12
在meteor中,变量的作用域是它们特定的文件。因此,您需要公开Joose。您必须在某个lib文件中使用
Joose = Npm.require('joose');而不是
var Joose = Npm.require('joose');https://stackoverflow.com/questions/17289708
复制相似问题