sap.ui.define( ["sap/ui/core/mvc/Controller", "sap/ui/core/routing/History"], /** * @param {typeof sap.ui.core.mvc.Controller} Controller */ function (Controller, History) { "use strict"; return Controller.extend("mvcapp00124.controller.BaseController", { /** * @override */ onInit: function () { }, getRouter: function() { return sap.ui.core.UIComponent.getRouterFor(this); }, onNavBack: function(oEvent) { var oHistory, sPreviousHash; oHistory = History.getInstance(); sPreviousHash = oHistory.getPreviousHash(); if(sPreviousHash !== undefined) { window.history.go(-1); }else { this.getRouter().navTo("home", {}, {}, true); } } }); }, );