0
votes

I've found several ways to register and load sources within the current application folder (https://sapui5.netweaver.ondemand.com/sdk/docs/guide/9c5a9619f69f4a819f91fc89d9ff56f1.html)

But how to do this in javascript code (not the html-file) when I want to reuse components or controls from outside the current application, for instance from a reusable custom ui5-control-library project?

so for instance, my current application root is here: http://www.example.org/ui5projects/application1 and within this application I want to load sources from here http://www.example.org/ui5projects/controllibraryproject in order to reuse coding over several projects?

As far as I understand I'd have to use https://openui5.hana.ondemand.com/docs/api/symbols/jQuery.sap.html#.registerModulePath using the listed parameter or https://openui5.hana.ondemand.com/docs/api/symbols/jQuery.sap.html#.includeScript for what I want to achieve?

I've found a similar question here Adding a custom library as a dependency in SAP Fiori but I'm not getting it running using registerModulePath

1

1 Answers

1
votes

Obviously jQuery.sap.registerModulePath("res", "path") is the way to go.

But you need to invoke jQuery.sap.require(res'); afterwards