Ember.js 如何导入命名的amd';s及其在ember cli中的导出

Ember.js 如何导入命名的amd';s及其在ember cli中的导出,ember.js,ember-cli,Ember.js,Ember Cli,我正试图导入到ember cli项目中,但由于某些原因,我一直出现以下错误: 未捕获错误:把手错误:在对象(生成的应用程序控制器)上找不到属性“ic modal trigger”。 我有以下进口声明: app.import('vendor/ic-styled/main.js'); app.import('vendor/ic modal/dist/named amd/main.js'{ “ic模态”:[ “ModalComponent”, “ModalFormComponent”, “Modal

我正试图导入到ember cli项目中,但由于某些原因,我一直出现以下错误:

未捕获错误:把手错误:在对象(生成的应用程序控制器)上找不到属性“ic modal trigger”。

我有以下进口声明:

app.import('vendor/ic-styled/main.js');
app.import('vendor/ic modal/dist/named amd/main.js'{
“ic模态”:[
“ModalComponent”,
“ModalFormComponent”,
“ModalTriggerComponent”,
“ModalTitleComponent”,
“modalCss”
]
});


能帮上忙就好了

Brocfile.js
中:

app.import('bower_components/ic-styled/main.js');
app.import('bower_components/ic-modal/dist/named-amd/main.js');
如果您仍在使用较旧版本的Ember CLI,请将上文中的
bower_组件
替换为
vendor

然后使用:

import ICModal from 'ic-modal';
// Can now utilise ICModal, ICModal.ModalForm etc
西兰花构建和ES6模块传输机应负责其余部分


(旁注:在使用Coffeescript时,请将
import
语句放在后面,因为标准Coffeescript编译器不处理ES6语法。)

您找到解决方案了吗?