In backbone.js, is it possible to add an additional attribute to a collection? I have a model attached to it, but need to define a common attribute for all model entities that I would naturally see located best at the collection level.
Any thoughts?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is javascript, everything is possible! You can attach anything to collection’s constructor function, to collection’s prototype, to a concrete instance of the collection. And the same is true for models.