Skip to content

Instantly share code, notes, and snippets.

@pgdaniel
Last active January 4, 2016 18:49
Show Gist options
  • Select an option

  • Save pgdaniel/8662716 to your computer and use it in GitHub Desktop.

Select an option

Save pgdaniel/8662716 to your computer and use it in GitHub Desktop.
class App.Screen.Views.ScreensView extends Backbone.View
initialize: ->
@sv = App.Screen.Views.ScreenView
@collection.on "add", @addOne, @
@collection.on "reset", @addAll, @
addOne: (screenItem) ->
screenView = new @sv({model: screenItem})
@$el.append(screenView.render().el)
#good here
console.log screenView.$el
addAll: ->
console.log "ADD ALL"
console.log @collection.length
@collection.forEach(@addOne, @)
render: ->
@addAll()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment