Skip to content

Instantly share code, notes, and snippets.

@mkysoft
Created October 25, 2019 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkysoft/b3f04f1ebe876712d963dcb2dfe5228b to your computer and use it in GitHub Desktop.
Save mkysoft/b3f04f1ebe876712d963dcb2dfe5228b to your computer and use it in GitHub Desktop.
Change root view on app init for UI5
sap.ui.define([
"sap/ui/core/UIComponent",
"sap/ui/Device"
], function(UIComponent, Device, models) {
"use strict";
return UIComponent.extend("sap.ui.demo.myapp.Component", {
metadata: {
manifest: "json"
},
init: function() {
UIComponent.prototype.init.apply(this, arguments);
//Change root view
this.getRootControl().setViewName("sap.ui.demo.myapp.view.App");
this.getRouter().initialize();
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment