Reputation: 424
As the title said, I can't figure out how to define a route for an Ember.js Engines in an Ember.js Application.
I tried to follow the tutorial, but I don't understand how the route work.
An add-on made with ember-engines cannot be placed in the Application, so where should he be placed? In another repository, I suppose, but then how to define its route in the app/router.js.
I will recap everything I have done until now:
ember addon myAddon
ember install ember-engines
Right now, I have two repositories, but the addon one is quite empty. So we will add in this repository all the things that are needed for the addon to "work."
Added my environment variable, my index.js, my addon/route.js and my engine.js.
I putted <h3>Hello World!</h3>
in my addon/templates/application.hbs.
And here comes the problematic part. How do I call the addon in my application? I mean in the router.js of my application?
this.mount('myAddon');
this.mount('myAddon', { path: '../../addon/myAddon});
which is the path to my addon, but I can of understand this is not a good way to call it.So if any of you can help me out, that will be very appreciated.
Upvotes: 0
Views: 768
Reputation: 424
I solved it. The problem was not in the addon itself, but in the package.json of my app. I just added in the dependencies
"myAddon": "path/to/my/addon"
.
Upvotes: 0