I read below codes and try to understand keyword this refer to which object.
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/m/MessageToast",
"sap/ui/model/json/JSONModel"
], function (Controller, MessageToast, JSONModel) {
"use strict";
return Controller.extend("myAppAddress.controller.App", {
onInit : function () {
// set data model on view
var oData = {
recipient : {
name : "World"
}
};
var oModel = new JSONModel(oData);
this.getView().setModel(oModel);
},
onShowHello : function () {
MessageToast.show("Hello World");
}
});
});
As my understanding, this should refer to the extended controller "myAppAddress.controller.App". As the attached debugger screenshot I checked, this itself does not contain the methods onInit and onShowHello, but at its upper level. What is wrong of my understanding? Thanks in advance if someone can give the answer.