Skip to content

Instantly share code, notes, and snippets.

@alexgby
Created December 19, 2012 06:55
Show Gist options
  • Select an option

  • Save alexgby/4334936 to your computer and use it in GitHub Desktop.

Select an option

Save alexgby/4334936 to your computer and use it in GitHub Desktop.
Example Backbone Boilerplate module in Coffeescript
# Example module
define [
# Application.
"app"
],
# Map dependencies from above array.
(app) ->
# Create a new module.
Example = app.module()
# Default Model.
class Example.Model extends Backbone.Model
# Default Collection.
class Example.Collection extends Backbone.Collection
model: Example.Model
# Default View.
class Example.Views.Layout extends Backbone.Layout
template: "example"
# Return the module for AMD compliance.
return Example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment