2

With respect to this question, I created an ember-addon project and it is working fine as expected.

But If I try to introduce pods structure in the ember-addon project it is not working.

It throws error that the route is not found.
What should I do?


Thanks In Advance!

Community
  • 1
  • 1
freakydavid
  • 114
  • 6
  • 1
    do you know which route isn't found? – NullVoxPopuli Mar 18 '19 at 20:03
  • @NullVoxPopuli the route from the addon is not found in the consuming app – freakydavid Mar 19 '19 at 05:53
  • You'll need to use blueprints to add the routes to the parent app's router. If I understand it right, ember-engines solves this in a different way. For blueprints use afterInstall hook and this.insertIntoFile into the 'app/router.js' to insert the routes as big js string. – cythrawll Mar 19 '19 at 16:30
  • Here is an example from my OSS project: https://github.com/yahoo/navi/blob/master/packages/reports/blueprints/navi/index.js – cythrawll Mar 19 '19 at 16:37
  • @freakydavid Did you had a look at this StackOverflow question? https://stackoverflow.com/questions/39013075/add-route-to-ember-addon The accepted answer works fine even in latest ember versions. – jelhan Mar 19 '19 at 23:20
  • @jelhan I found the answer...Thanks for help – freakydavid Mar 20 '19 at 08:42

2 Answers2

0

Thanks everyone for the help....My issue was that if I try to use pods structure in ember addon,It won't compile the template files.This is an existing issue in ember-cli.

With reference to issue in the github...they have provided the workarounds possible for lower version of ember

freakydavid
  • 114
  • 6
0

As mentioned in the official docs, addons should not use the pods structure:

Addons should only use the classic structure for compatibility with either classic or pods-based consuming application.

Mahmoud
  • 1,703
  • 1
  • 9
  • 13