Skip to content

Instantly share code, notes, and snippets.

@dagda1
Created June 30, 2011 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagda1/1056202 to your computer and use it in GitHub Desktop.
Save dagda1/1056202 to your computer and use it in GitHub Desktop.
observations.coffeescript
class Observation extends Backbone.Model
class Observations extends Backbone.Collection
model: Observation
class ObservationsView extends Backbone.View
el: $('#observations')
constructor: ->
@url = _observationsUrl
initialize: ->
_.bindAll @
@model.bind 'change', @render
render: =>
alert('rendering baby')
class ObservationsController extends Backbone.Controller
initialize: ->
observations = new Observations()
observationsView = new ObservationsView(model: observations)
class App
init: ->
@Views = {}
@Collections = {}
@Controllers = {}
@templates = Utils.loadTemplates()
@Controllers.Main = new ObservationsController()
$ ->
app = new App()
app.init()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment