1. Syntax
sap.ui.define([
, function( ) {
});
});
Example
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/m/MessageToast"
], function(Controller, MessageToast) {
"use strict";
return Controller.extend("ui5.walkthrough.controller.App", {
onShowHello: function() {
MessageToast.show("Hello World");
}
});
});
2. Explain
Write in Webapp/index.js
sap.ui.define is function to declare a new module in SAP UI5
[] : array store: path of module dependencies, example: "sap/ui/core/mvc/Controller"
function( ) { }); module name is parameter of function, so called callback function.
3. Debugging
-Add breakpoint in F12(devtools)
-Add line: debugger;
Top comments (0)