github.com/SAP/cloud-mta-build-tool@v1.2.27/internal/archive/testdata/testbuildparams/ui2/webapp/Component.js (about)

     1  company.ui.define([
     2  	"company/ui/core/UIComponent",
     3  	"company/ui/Device",
     4  	"b/ui2/model/models"
     5  ], function (UIComponent, Device, models) {
     6  	"use strict";
     7  
     8  	return UIComponent.extend("b.ui2.Component", {
     9  
    10  		metadata: {
    11  			manifest: "json"
    12  		},
    13  
    14  		/**
    15  		 * The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
    16  		 * @public
    17  		 * @override
    18  		 */
    19  		init: function () {
    20  			// call the base component's init function
    21  			UIComponent.prototype.init.apply(this, arguments);
    22  
    23  			// enable routing
    24  			this.getRouter().initialize();
    25  
    26  			// set the device model
    27  			this.setModel(models.createDeviceModel(), "device");
    28  		}
    29  	});
    30  });