on 2020 Jun 17 11:11 PM
Request clarification before answering.
Hi Andres,
you can do following steps:
First, create your model in the manifest.json: see https://blogs.sap.com/2016/10/11/sapui5-load-local-json-model-directly-manifest.json/
Storing a model in the Core is not recommended.
in your UI5 Controller:
onInit: function() {
var oModel = this.getOwnerComponent().getModel("userModel");
oModel.attachRequestCompleted(function(oEvent) {
console.log(userModel.getProperty("/name"));
});
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
userModel.getProperty("/name")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
data loading is async, you cannot access it directly after the model creation.
User | Count |
---|---|
50 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
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.