Skip to Content
0
Oct 17, 2013 at 02:32 PM

JSONModel getProperty() fails

293 Views

Hi,

I have the following code:

var oModel = new sap.ui.model.json.JSONModel();

oModel.loadData("credentials.json");

var user = oModel.getProperty("/credentials/benutzer");

And the following JSON file:

{

"credentials": {

"benutzer": "test",

"passwort": "test"

}

}

When I say now alert(user) I always get "undefined" ...

Does anybody now why it doesn't work?

Greetings

Stef