Created
December 22, 2014 15:30
-
-
Save thenickcox/2ef9b0de24cf2541f9d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.Collections.Albums = Backbone.Collection.extend | |
model: App.Models.Album | |
url: "/users/2/albums" | |
featured: -> | |
@where(featured: true) | |
App.AlbumsListView = Backbone.View.extend | |
el: '#featured' | |
initialize: -> | |
@listenTo @collection, 'sync', @render | |
render: -> | |
for model in @collection.featured() | |
itemView = new App.AlbumItemView(model: model) | |
@$el.append itemView.render().el |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment