mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-29 22:09:24 +08:00

* new app * update structure * update folder structure * update * update * update * Delete src/01/03/z2ui5_cl_ui5_cc_js.clas.abap * update * Update src/02/z2ui5_if_types.intf.abap Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * update * update --------- Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
45 lines
1.2 KiB
ABAP
45 lines
1.2 KiB
ABAP
CLASS z2ui5_cl_ui5_model_js DEFINITION
|
|
PUBLIC
|
|
FINAL
|
|
CREATE PUBLIC .
|
|
|
|
PUBLIC SECTION.
|
|
|
|
CLASS-METHODS get
|
|
RETURNING
|
|
VALUE(result) TYPE string.
|
|
|
|
PROTECTED SECTION.
|
|
PRIVATE SECTION.
|
|
ENDCLASS.
|
|
|
|
|
|
|
|
CLASS z2ui5_cl_ui5_model_js IMPLEMENTATION.
|
|
|
|
METHOD get.
|
|
|
|
result = `sap.ui.define([` && |\n| &&
|
|
` "sap/ui/model/json/JSONModel",` && |\n| &&
|
|
` "sap/ui/Device"` && |\n| &&
|
|
`], ` && |\n| &&
|
|
`function (JSONModel, Device) {` && |\n| &&
|
|
` "use strict";` && |\n| &&
|
|
|\n| &&
|
|
` return {` && |\n| &&
|
|
` /**` && |\n| &&
|
|
` * Provides runtime info for the device the UI5 app is running on as JSONModel` && |\n| &&
|
|
` */` && |\n| &&
|
|
` createDeviceModel: function () {` && |\n| &&
|
|
` var oModel = new JSONModel(Device);` && |\n| &&
|
|
` oModel.setDefaultBindingMode("OneWay");` && |\n| &&
|
|
` return oModel;` && |\n| &&
|
|
` }` && |\n| &&
|
|
` };` && |\n| &&
|
|
|\n| &&
|
|
`});`.
|
|
|
|
ENDMETHOD.
|
|
|
|
ENDCLASS.
|