我已经创建了rember in-repo-addon。假设say-hello
。之后,我创建了ember-ininge。假设users-engine
。
在5月的主要应用程序中,我可以直接将插件用作
//application.hbs
{{say-hello}}
如何在用户发动机中使用它?
//lib/users-engines/templates/index.hbs
{{say-hello}} //It is not working also not throwing any error
我找到了答案,但不确定它是否正确。
在 users-engine/package.json
中添加相对路径
{
"name": "users-engine",
"keywords": [
"ember-addon",
"ember-engine"
],
"dependencies": {
"ember-cli-htmlbars": "*"
},
"ember-addon": {
"paths": [
"../say-hello"
]
}
}
现在,您可以直接在Ember-Gine中使用内repo-addon。
//lib/users-engines/templates/index.hbs
{{say-hello}} //It is working now.