Show TOC

App Initialization: What Happens When an App Is Started?Locate this document in the navigation structure

When a user starts an app (in the SAP Fiori launchpad (FLP) or using an HTML page), several steps will be performed in the background.

User starts the app. Component container loads the component (Component.js) of the app. Component loads descriptor (manifest.json) that is referenced in the Component.js file. Component creates models that are defined in the descriptor (default model and resource models (i18n)). init function of Component.js is executed. init function of the component calls init function of parent UIComponent (This has to be implemented by the app developer!). init function of UIComponent creates router and root view as defined in descriptor. Root view creates root control. init function of component initializes router (This has to be implemented by the app developer!). Router creates necessary views depending on the hash in the URL with which the app has been started. View loads corresponding controller. init function of controller is executed. Router places views in root control: models are now available within the view and its controller. Bindings of views are evaluated. Data is retrieved from model. Views are updated. User can interact with the app.
Figure 1: Initialization process

When a user closes the app, the destroy function of the component is called. All models and the router are destroyed. The router will take care of destroying the views.

If a controller has created resources that need to be destroyed explicitly, for example non-aggregated controls, the app developer has to use the onExit function of the controller to free up resources. For more information, see Controller.