Created
July 17, 2012 20:06
-
-
Save carpeliam/3131706 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
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