Using the
define
plugin from Map allows you to specify a type of any attribute of the
model. By specifying a type
of "*" for the array attribute, it will prevent the default
type conversion of arrays into can.Lists or objects into can.Maps. You
just need to add the define attribute to the instance/prototype section
of your model.
define: {
my_stuff_list: {type: "*"},
my_info: {type: "*"}
},
Assuming my_stuff_list is an array and my_info is an object, this will ensure that when the model object is created, they will be created as javascript array and object.