Can a Backbone.js View have a Model and a Collection?
The reason I am asking is because I’m working with a View that holds a map with places plotted on it (using the leaflet library).
The Collection is of a group of models that hold coordinates to be plotted on the map.
The Model holds stuff like the map bounds and map shape.
Not sure how else to pull this one off…
Any help is appreciated, thanks!
Yes, you can pass it in as simply as:
and inside the view you can access both with:
jsfiddle for example