Skip to content

Instantly share code, notes, and snippets.

@zozo
Created September 9, 2012 11:00
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 zozo/3683797 to your computer and use it in GitHub Desktop.
Save zozo/3683797 to your computer and use it in GitHub Desktop.
App = new Backbone.Marionette.Application()
App.addRegions
content: "body"
class Model extends Backbone.Model
class Models extends Backbone.Collection
model: Model
class ItemView extends Backbone.Marionette.ItemView
template: _.template("item: <%= name %>")
class CompositeView extends Backbone.Marionette.CompositeView
template: _.template("<h1>LIST</h1><ul></ul>");
itemView: ItemView
App.addInitializer ->
@collection = new Models()
view = new CompositeView
collection: @collection
App.content.show(view)
@collection.reset([new Model({name: 'some name'})])
jQuery -> App.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment