我正在尝试在Ember中使用一个名为techan.js的库。它依赖于d3.js。
在我的Brocfile.js中,我有:
组件(‘bower_components/d3/D3.js’);app.import('bower_components/TechanJS/dist/techan.js');
在使用像Requirejs这样的AMD库时,您可以定义依赖项并以正确的顺序加载它们。Ember也有类似的能力吗?
发布于 2015-06-12 23:04:11
是的,ember支持具有依赖关系的库。在完成所有步骤之后,您只需将d3和tech声明为全局变量,以避免您看到的错误。
//console
bower install --save andredumas/techan.js
//Brocfile.js
...
app.import('bower_components/d3/d3.js');
app.import('bower_components/TechanJS/dist/techan.js');
module.exports = app.toTree();
//.jshintrc
{
"predef": [
//...,
"d3",
"techan"
],
// ...
}
//console
ember serverhttps://stackoverflow.com/questions/30793845
复制相似问题