cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

I am changing the pre-load property in my index.html tag to ''async".

When I do that, I believe below code makes sure that my application or component.js file doesn't get loaded until all the required SAPUI5 libraries are loaded. If I am correct till now, may I know if sap.ui.getCore().attachInit() acts as a promise and only when this is resolved the callback function within the attachInit() will get executed ?

Again, if I am correct till now, then may I know where are we making sure that sap.m library and other SAPUI5 libraries are also loaded, as I only see attachInit for sap.ui library.

If I am completely off mark, please let me know how do we handle the async pre-load in SAPUI5 applications and how can we set the pre-load='async' property in application where index.html is not available.

<script>
			sap.ui.getCore().attachInit(function() {
				new sap.m.Shell({
					app: new sap.ui.core.ComponentContainer({
						height : "100%",
						name : "com.sunSampleGetData"
					})
				}).placeAt("content");
			});
		</script>
View Entire Topic
saurabh_vakil
Active Contributor
0 Likes

Check Use Asynchronous Loading , the async property can be added to the manifest.json file as well. Also check the recommendations given here - Is Your Application Ready for Asynchronous Loading?