Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Re: Best practice to store global data?

$
0
0

Hi Sascha,

 

one option would be to store your JSON Object via a JSON Model in the sap.ui.core.

  • Create your JSON Object.
  • Create a JSON Model and add the JSON object to it (var oJSONModel = new sap.ui.model.json.JSONModel(<your JSON Object>);).
  • Add JSON Model to core (sap.ui.getCore().setModel(oJSONModel, <your identifier>);).
  • With sap.ui.getCore().getModel(<your identifier>); you can access the JSONModel.

 

But as always: Avoid global things if possible

 

Regards,

Florian


Viewing all articles
Browse latest Browse all 9236

Trending Articles