Alexis Revue
Posts: 0
Joined: Wed Jul 02, 2014 4:28 am

How to access a model variable in Javascript?

Hello,

http://devcenter.appery.io/documentat...

I've created a model "A" with a property "B" in model tab.
I've created a storage variable "C" with "A" type in storage tab.

How can I access (get & set) the B property of C variable in javascript?

I tried these lines but it doesn't work...
alert(Apperyio.storage.storageVariable.get("$['C']"));
alert(Apperyio.storage.storageVariable.get("$['C']['B']"));

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to access a model variable in Javascript?

Hi Alexis,

You can read a value of 'B' this way:
prevar valueB = Apperyio.storage.C.get("$['B']");/pre

Return to “Issues”