You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to add some additional functionality to the built-in routes and I am wondering if there is a preferred method for doing this. My first thought was to extend the routes by creating a local route named the same thing in my theme (e.g routes/index.js).
This does what I would expect, it replaces the add-on route. What I want, however, is to extend the addon route. I have tried several permutations of an import statement to import and extend the add-on route but nothing seems to work.
// import Route from '@ember/routing/route';import{defaultasIndexRoute}from'empress-blog/addon/routes/index';exportdefaultclassIndexextendsIndexRoute{constructor(){super(...arguments);}// custom stuff here...}
I get an import error Error: Could not find module 'empress-blog/addon/routes/index' imported from 'my-app-theme/routes/index'. I am not sure if it's because the add-on adds the route into the consuming app's app folder or if I need to do some broccoli magic. Anyway, any thoughts you have would be appreciated. For now, the work around I am doing is to copy the contents of the route in the addon into my local route and just replace the one coming from the addon.
The text was updated successfully, but these errors were encountered:
I am trying to add some additional functionality to the built-in routes and I am wondering if there is a preferred method for doing this. My first thought was to extend the routes by creating a local route named the same thing in my theme (e.g routes/index.js).
This does what I would expect, it replaces the add-on route. What I want, however, is to extend the addon route. I have tried several permutations of an import statement to import and extend the add-on route but nothing seems to work.
I get an import error
Error: Could not find module 'empress-blog/addon/routes/index' imported from 'my-app-theme/routes/index'
. I am not sure if it's because the add-on adds the route into the consuming app's app folder or if I need to do some broccoli magic. Anyway, any thoughts you have would be appreciated. For now, the work around I am doing is to copy the contents of the route in the addon into my local route and just replace the one coming from the addon.The text was updated successfully, but these errors were encountered: