Jerry’s previous article on How to Integrate Third-Party Libraries in SAP UI5 Applications: A Tip for Viewing Printed Debugging Information for Web Applications on a Mobile Device described a technique for defining and using third-party libraries in SAP UI5.
Later, in my technical communication group, SAP expert Guo Ye reported that there is another way to define dependencies in the SAP UI5 Manifest. json file.
This article introduces the second method. In the SAP UI5 project, create a new lib folder and put the third party library files in it. Then define the references to the third party library files in the SAP. UI5 section of the manifest.
The source code:
"The resources" : {" js ": [{" uri" : "lib/vconsole - min. Js", "name" : "vconsole - min. Js", "version" : "3.7.0}]}
At run time, the VConsole library was successfully loaded.
Of course, manually loading third-party libraries in the SAP UI5 controller with the following statements also works:
jQuery.sap.require(“SAPUI5ExternalLibs/libs/moment”);
Third-party libraries loaded in this way are greedy, that is, when the SAP UI5 application is initialized, the third-party libraries will be loaded. Jerry’s previous article on how to integrate third-party libraries in SAP UI5 applications: One of the tips for viewing debugging information printed on a Web application on a mobile device is the lazy loading method, that is, only when the controller that uses the functionality of the third-party library and the corresponding view of the controller are used by the user, the third party library is actually triggered to load.
More of Jerry’s original articles can be found on “Wang Zixi “: