在我的 index.html 文件中,我有以下代码:
<script>
sap.ui.getCore().attachInit(function() {
jQuery.sap.registerModulePath("lodash","https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min");
jQuery.sap.require("lodash");
new sap.m.Shell({
app: new sap.ui.core.ComponentContainer({
height : "100%",
name : "sap.com.ml.docservicedoc-service-m-learning"
})
}).placeAt("content");
});
Run Code Online (Sandbox Code Playgroud)
我现在如何在我的控制器之一(而不是视图)中使用 lodash?我试过:
sap.ui.define([
"sap/ui/core/mvc/Controller",
"lodash"], function(Controller, _) {
Run Code Online (Sandbox Code Playgroud)
不幸的是“_”始终是未定义的。
sapui5 ×1