Skip to content

Instantly share code, notes, and snippets.

@carpeliam
Created July 17, 2012 20:06
Show Gist options
  • Save carpeliam/3131706 to your computer and use it in GitHub Desktop.
Save carpeliam/3131706 to your computer and use it in GitHub Desktop.
Parent extends Backbone.Model
initialize: ->
# should the model listen to child events here and fire a separate event?
@children = new Backbone.Collection([], model: Parent)
ObjView extends Backbone.View
initialize: ->
@collection = new Backbone.Collection([], model: Parent)
# should the view try to be responsible for listening to any sync on any child, no matter how deep?
@collection.each (m) ->
m.on 'sync', =>
@$('.last-updated').replaceWith "Last updated at #{timestamp of most recent model}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment