4
我在iframe中有web app
和Ember app
。我想从web app
导入自定义库到ember app
像全局变量。库看起来像带有功能的对象:在ember-cli中导入自定义库
var helpers = {
helper1: function() {},
helper2: function() {}
};
使用套接字的库和两个应用程序的库都一样。
我写道:
app.import("./../../../public/scripts/js-helpers.js"); //file located in web app
我无法访问变量helpers
项目和灰烬,CLI复制文件夹public
到他们的工作文件夹。对不起,如果问题是愚蠢的,我不明白ember-cli
进口原则。
谢谢,它的工作原理。但是,我如何能够在ember根目录之外导入文件。 Ember只搜索tmp目录下的''/ chat/tmp/tree_merger-tmp_dest_dir-5dhDCkaV.tmp /../../../ public/scripts/js-helpers.js'和build(用'/../。 ./../')会产生错误的路径。 – user1156168 2014-08-29 08:44:12