1.

How Can You Set Attributes Of A Model?

Answer»

You can set attributes of a model in two ways. USING constructor parameter or .set().

See the below EXAMPLE:

var myObj = new MYCLASS({ attrib1: "Thomas", attrib2: 67});

//Or we can set afterwards, these OPERATIONS are equivalent
var myObj = new MyClass();
myObj.set({ attrib1: "Thomas", attrib2: 67});

You can set attributes of a model in two ways. Using constructor parameter or .set().

See the below example:

var myObj = new MyClass({ attrib1: "Thomas", attrib2: 67});

//Or we can set afterwards, these operations are equivalent
var myObj = new MyClass();
myObj.set({ attrib1: "Thomas", attrib2: 67});



Discussion

No Comment Found