Skip to content

Instantly share code, notes, and snippets.

@thenickcox
Created December 22, 2014 15:28
Show Gist options
  • Save thenickcox/0a2fb302811f313888b8 to your computer and use it in GitHub Desktop.
Save thenickcox/0a2fb302811f313888b8 to your computer and use it in GitHub Desktop.
App.AlbumsListView = Backbone.View.extend
el: '#featured'
initialize: ->
@listenTo @collection, 'sync', @render
render: ->
for model in @collection.models
itemView = new App.AlbumItemView(model: model)
@$el.append itemView.render().el
$ ->
App.albums = new App.Collections.Albums
App.albumsListView = new App.AlbumsListView(collection: App.albums)
App.albums.fetch()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment