Skip to content

Instantly share code, notes, and snippets.

@adjohu
Created June 27, 2012 20:47
Show Gist options
  • Save adjohu/3006759 to your computer and use it in GitHub Desktop.
Save adjohu/3006759 to your computer and use it in GitHub Desktop.
Base Collection
Spine = require('spine')
class BaseCollection extends Spine.Controller
items: [],
itemTemplate: "abc"
constructor: ->
super
addOne: (atts) ->
@items.push new @controller
atts: atts
template: @itemTemplate
console.log(@items)
addAll: (attsList...) ->
@addOne atts for atts in attsList
render: ->
for item in @items
console.log(item)
@el.append(item.render())
module.exports = BaseCollection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment