In a discussion titled ‘How to Modify Ember Route Class’ under the Dev category, saurabhmasc asked if Ember Route classes can be modified using api.modifyClass similarly to Controller and Component classes. justin confirmed it’s possible using route:route-name. When saurabhmasc tried overriding the createTopic action in route:tags-show, they encountered a ReferenceError: Composer is not defined. Johani explained that since theme scripts can’t use import, Composer must be loaded via require('discourse/models/composer'). They also recommended reading Splitting Up Theme JavaScript Into Multiple Files for better theme development practices, as it aligns more closely with core Discourse examples and improves maintainability.
Hello All,
I want to modify the Ember Route class (/app/assets/javascripts/discourse/routes/tags-show.js.es6) in the same way that we modify Controller and Component classes using pluginAPI.
An example that we modify composer.js.es6 controller as below: