如何在ember-engine中使用in-repo-addons?

时间:2016-12-14 07:09:00

标签: javascript ember.js ember-addon ember-engines

我已创建并包含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 

1 个答案:

答案 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.