on 11-29-2016 12:53 PM
Hey,
i want to make my App offline capable. How can I load all controller files at the beginning of my App? Currently the controller files only get loaded when they are needed.
Thanks for your help and best regards,
David
Create a component-preload.js file with all of the app contents contained within it.
https://help.hana.ondemand.com/webide/frameset.htm?dfb26ef028624cf486a8bbb0bfd459ff.html
Regards,
Jamie
SAP - Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd also say this is the best approach to answer the question: you app should be a component based app that loads the Component-preload.js file. I don't know how your dev setup looks like, but it's quite easy to generate the Component-preload.js file using grunt. Have a look at grunt-openui5 and also at the Optimizing UI5 Apps blog by Matthias Osswald. The blog Deploying UI5: Putting all the tasks together by Nigel James is another good read.
Using this approach even makes sure you have your views loaded as well. However, keep in mind that some resources like image files etc. will not be available for offline use this way. So for those other resources (which will not be part of the generated Component-preload.js file) you should implement a "pre-fetching" strategy if this is really needed (maybe inside the Component.js file).
Or you can use Gulp as task runner: Distribution package for an UI5 application
using <script> tag you can load all javascripts files inside <head> tag in index.html.
Regards,
Akhilesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you must have one html file in your app, you can use that file.
OR
you can use jQuery.sap.require, check below link, or you can use component-preload as Jamie suggested.
Modularization and Dependency Management
Thanks,
Akhilesh
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.