jashkenas / backbone

Give your JS App some Backbone with Models, Views, Collections, and Events
http://backbonejs.org
MIT License
28.09k stars 5.38k forks source link

Backbone Model attributes type #4194

Closed mveer-agarwal closed 6 years ago

mveer-agarwal commented 6 years ago

Hi All,

Backbone model attributes can be string, objects, backbone collection etc. But is it possible that an attribute is an array of backbone model?

Ex: var Model - Backbone model Model.get('charts') - Simple array [chart], here chart is the backbone model

Here my question is that ideally Backbone model attribute is if having array then it should be backbone collection or can be simple array of backbone Model?

Thanks Mahaveer

paulfalgout commented 6 years ago

A model attribute can be set to any value you can set a variable to.

I'd recommend stack overflow or https://github.com/jashkenas/backbone for questions like this.