on 10-27-2015 10:16 AM
Hi,
Can someone tell me the best way to reuse javascript files in different sapui5 applications. Where is the best save these files/functions in my abap system.
Kind regards,
Richard Middelburg
is it possible to save the JS files under ABAP System?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can make use of jQuery.sap.registerModulePath method and access js file from other applications just similar to how you'd access within the same app.
JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - jQuery.sap
two things to add
sap.ui.component.load( {
name : "xxx.hcm.mss.utils.Component",
url : "/mss/util/"
});
and
jQuery.sap.registerResourcePath("xxx/hcm/mss/utils", "/mss/util/");
which technically the same thing as registerModulePath but with no "."->"/" conversion
jQuery.sap.registerModulePath = function registerModulePath(sModuleName, vUrlPrefix) {
jQuery.sap.assert(!/\//.test(sModuleName), "module path must not contain a slash.");
sModuleName = sModuleName.replace(/\./g, "/");
// URL must not be empty
vUrlPrefix = vUrlPrefix || '.';
jQuery.sap.registerResourcePath(sModuleName, vUrlPrefix);
};
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.