Adding a custom JavaScript file for the backoffice
I'm currently working on a project for the Umbraco backoffice where I need to add some custom Angular routes before the ones provided by Umbraco by default (in the file /umbraco/js/routes.js).
Since any JavaScript file I list in my package.manifest is added after /umbraco/js/routes.js, I haven't found a way to make this work.
When running the site in debug mode, I can see that the individual JavaScript files are added via the URL /umbraco/Application (if not in debug mode, the files are bundled with ClientDependency).
My question now is: Is it possible to modify which files are listed in the /umbraco/Application response? Eg. slip in my own JavaScript file right before /umbraco/js/routes.js?
Sorry, there's no way to do that. Perhaps if you added a custom WebApi route in ApplicationStarted that overlapped with /umbraco/Application, WebApi might use your WebApi route... then you'd have to duplicate exactly what the BackOfficeController.Application action does but you could return your own data.
Adding a custom JavaScript file for the backoffice
I'm currently working on a project for the Umbraco backoffice where I need to add some custom Angular routes before the ones provided by Umbraco by default (in the file
/umbraco/js/routes.js
).Since any JavaScript file I list in my package.manifest is added after
/umbraco/js/routes.js
, I haven't found a way to make this work.When running the site in debug mode, I can see that the individual JavaScript files are added via the URL
/umbraco/Application
(if not in debug mode, the files are bundled with ClientDependency).My question now is: Is it possible to modify which files are listed in the
/umbraco/Application
response? Eg. slip in my own JavaScript file right before/umbraco/js/routes.js
?Sorry, there's no way to do that. Perhaps if you added a custom WebApi route in ApplicationStarted that overlapped with /umbraco/Application, WebApi might use your WebApi route... then you'd have to duplicate exactly what the BackOfficeController.Application action does but you could return your own data.
Thanks for your answer.
My goal was to create custom pages that are not a part of a section/tree, but it seems to require too many hacks. Would be an awesome feature though.
is working on a reply...