Created
April 1, 2012 04:38
-
-
Save randallb/2271437 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
exports.Collection = class Posts extends Backbone.Collection | |
initialize: (models, options) => | |
@id = options.id | |
@activeDetails = false | |
@on "loadDetails", @loadDetails | |
@on "detailsLoaded", @logger | |
debug "initialized posts" | |
@fetch | |
beforeSend: () => | |
console.log "about to fetch..." | |
@trigger "postsLoading" | |
success: (collection, response) => | |
debug "successfully loaded ajax" | |
@trigger "postsLoaded" | |
error: (collection, response) => @trigger "postsLoadingError" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment