I need help with setting JSON model into my main model. I have data stored in "http://localhost:9041/main-app-web/MyServiceName.svc/GetSurname?id=1&name='matt'&$format=json"
Now i want to set it into model, i'm trying
var oModelJs = new sap.ui.model.json.JSONModel("/main-app-web/MyServiceName.svc/GetSurname?id=1&name='matt'&$format=json");
this.getView().setModel(oModelJs, "model");
but it is giving me oData ={} , empty oData in debugger. How could i do that and then display my data eg. in table in xml?
Parameters stored in my json:
Id: "223",
MeterNumber: "1354-65498121"
Ty guys
The way i solved this problem was adding correct items into <Table items="{/d/results}">
and in cells <Text text="{id}" />
Ty for ur response santosh.