SAPUI5中的javascript-需要对简单方法调用进行JS初始化或如何导入;“需要基于js的”;SAP业务对象库
是否有人可以告诉我如何更改RequireJS定义:SAPUI5中的javascript-需要对简单方法调用进行JS初始化或如何导入;“需要基于js的”;SAP业务对象库,javascript,sapui5,business-objects,Javascript,Sapui5,Business Objects,是否有人可以告诉我如何更改RequireJS定义: (function (root, factory) { if (typeof define === 'function' && define.amd) { define([], factory(root)); } else if (typeof exports === 'object') { module.exports = factory(root); } else {
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory(root));
} else if (typeof exports === 'object') {
module.exports = factory(root);
} else {
root.someVariable = factory(root);
}
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) {
'use strict';
var $someVariable = {},
someAnotherVariable = 'bla bla bla',
....
var someFunction = function(someVar) {
}
...
return $someVariable;
});
例如:
var someVariable = callAllInsideAndReturnVariableValue(title, message);
详细地说。尝试将此JS()移动到简单函数调用,如前所述
或者可能有人知道如何在SAP UI5中使用此JS?SAP Design Studio中的详细信息(业务对象)
非常感谢你的帮助 引入工厂,以便为其他人正确初始化模块代码
if (typeof define === 'function' && define.amd) {
define([], factory(root)); //initialized through AMD
} else if (typeof exports === 'object') {
module.exports = factory(root)//initialized module loader,see: commonjs
} else {
root.someVariable = factory(root);//initialize to windows/global
}
我找到了解决方案,下面是如何将RequireJS库附加到DS组件的帖子:
万一有人也需要这样的解决方案:)这篇博文与sapui5/openui5有什么共同之处?这不是关于设计工作室吗?没错。与所讨论的相同。因为设计工作室有自己的行为。和。。我无法找到如何将其应用于DS。。后来发现。