cancel
Showing results for 
Search instead for 
Did you mean: 

Get property from model

0 Kudos

Hi all,

i got a model which was load in the component.js.

The model:

When I load the model in the controller.js is looks like:

As I want to insert a new entry I would like to read the property

	var oProperty = oModel.getProperty("/Nodes");

But oProperty is undefined if I use this. Waht am I doing wrong?

Many Thanks

Regards

Mario

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

Hi Mario Mueller,

Nodes.json is the file name and inside the file you have array of data. So the model is created and will be set with the data from that json model and it will not take the file name.

var oArray = oModel.getProperty("/");

You can also fetch the data like: oModel.getData()

If your data is in the below format then your code will work..
{
Nodes : [{..},{..}]
}

BR,
Mahesh

Answers (1)

Answers (1)

0 Kudos

Hi Mahesh,

great work!! Thanks a lot.

Regards

Mario