Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- sap.ui.getCore().attachInit(function() {
- sap.ui.component({
- id: "myComponentID",
- async: true,
- name: "myNamespace", // The namespace you defined in the bootstrap tag and points to the folder where the Component.js file is stored
- manifestFirst: true
- }).then(function(oNewComponent){
- new sap.m.Shell({
- app: new sap.ui.core.ComponentContainer({
- component: oNewComponent,
- height : "100%"
- })
- }).placeAt("content");
- })
- });
- </script>
- /**
- * The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
- * @public
- * @override
- */
- init: function() {
- //Map Component ID in a Core variable
- if(!sap.ui.getCore()._data_oLoadedComponents){
- sap.ui.getCore()._data_oLoadedComponents = {};
- }
- sap.ui.getCore()._data_oLoadedComponents.myCustomComponentId = this.getId(); // myCustomComponentId is the ID you want to use for this specific app
- // END: Map Component ID in a Core Variable
- // call the base component's init function
- UIComponent.prototype.init.apply(this, arguments);
- // set the device model
- this.setModel(models.createDeviceModel(), "device");
- }
- sap.ui.getCore().getComponent(sap.ui.getCore()._data_aLoadedComponents.myCustomComponentId)
- sap.ui.getCore().getComponent(sap.ui.getCore()._data_aLoadedComponents.myCustomComponentId).getModel('modelName')
Add Comment
Please, Sign In to add comment