Skip to content

Instantly share code, notes, and snippets.

@willrjmarshall
Created September 19, 2011 03:13
Show Gist options
  • Save willrjmarshall/1225906 to your computer and use it in GitHub Desktop.
Save willrjmarshall/1225906 to your computer and use it in GitHub Desktop.
window.Opjam =
Models: {}
Collections: {}
Routers: {}
Views: {},
init: ->
window.Player = new Opjam.Models.Player
window.PlayerView = new Opjam.Views.PlayerView { model: Player }
class Opjam.Views.PlayerView extends Backbone.View
el: '#test'
initialize: ->
@model.bind 'loadBroadcast', @render
@model.bind 'ready', @ready
@model.bind 'clear', @clear
render: ->
# render updated player w/ Broadcast info
alert(@model) # THIS FAILS - @model is undefined. WTF?
@el.innerHTML = @model.broadcast.name
ready: ->
# Hide loading gifs etc
clear: ->
# No track is actually loaded. Say something to this effect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment