我已创建并包含in-repo-addon。让我们说say-hello
。之后我创造了余烬。让我们说users-engine
。
在主要应用程序中我可以直接使用插件
//application.hbs
{{say-hello}}
如何在用户引擎中使用它?
//lib/users-engines/templates/index.hbs
{{say-hello}} //It is not working also not throwing any error
答案 0 :(得分:1)
我找到了答案,但不确定这是否正确。
在users-engine/package.json
添加插件的相对路径
{
"name": "users-engine",
"keywords": [
"ember-addon",
"ember-engine"
],
"dependencies": {
"ember-cli-htmlbars": "*"
},
"ember-addon": {
"paths": [
"../say-hello"
]
}
}
现在你可以直接在ember-engine中使用in-repo-addon。
//lib/users-engines/templates/index.hbs
{{say-hello}} //It is working now.