1.

How Can You Get The Attribute Value Of A Model?

Answer»

You can get the value of model attribute by USING .get() METHOD.

See the example below:

//Set attributes
var obj = NEW MYCLASS({ attrib1: "Attribute1", attrib2: 50});

//Get attributes
var attrib1 = obj.get("NAME"); // "Attribute1"
var attrib2 = obj.get("age"); // 50

You can get the value of model attribute by using .get() method.

See the example below:

//Set attributes
var obj = new MyClass({ attrib1: "Attribute1", attrib2: 50});

//Get attributes
var attrib1 = obj.get("name"); // "Attribute1"
var attrib2 = obj.get("age"); // 50



Discussion

No Comment Found