I have a web app that I want to use Backbone.js for. I have a list of common “items” which will not be edited by the user directly. This will appear essentially as a menu to choose from on the left side of the screen. When a user selects an item an “item instance” will be generated which they will customize.
I’m just wondering if this static list of items/templates should be handled by Backbone.js or if it should just be hardcoded. The value in using a Backbone Collection/Models for the list is that each item will have another Backbone.Model property that will be instantiated when that item is selected from the list. e.g. the HTMLImageChoice item, when selected, will result in an HTMLImage being instantiated.
I’m having trouble finding easy to follow examples of Backbone.js which are not very contrived.
Collections in backbone are collections of models. It seems like you are just talking about a hardcoded array of strings, which are totally not a model. Maybe you would want to hang that array off of a model as a property, but that is as close to backbone as it will get.