Skip to content

Instantly share code, notes, and snippets.

@Grummle
Forked from mikeobrien/gist:1376995
Created November 18, 2011 16:53
Show Gist options
  • Save Grummle/1377023 to your computer and use it in GitHub Desktop.
Save Grummle/1377023 to your computer and use it in GitHub Desktop.
class Flap extends Backbone.Model
class TimelineCollection extends Backbone.Collection
model: Flap
url: /tweets/
timeline = new TimelineCollection()
TweetView = Backbone.View.extend
initalize:->
@timeline = @options.timeline
@timeline.bind('reset',@display,@)
display:->
_.each(timeline.models,((model)->$(@el).append(model.render))
class TimelineRouter extends Backbone.Router
routes:
'*handle': 'enumerate'
initialize: ->
console.log 'Initializing TimelineRouter...'
@timeline = @options.timelineCollection
@timeline.fetch({data:{q:'somefilter'})
enumerate: (handle) ->
TimelineController.enumerate handle
$ ->
new TimelineRouter({timelineCollection:timeline})
Backbone.history.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment