Skip to content

Instantly share code, notes, and snippets.

@srdjan
Created February 27, 2012 21:52
Show Gist options
  • Select an option

  • Save srdjan/1927346 to your computer and use it in GitHub Desktop.

Select an option

Save srdjan/1927346 to your computer and use it in GitHub Desktop.
batmanjs Todo app
class App extends Batman.App
@global(yes)
@root('todos#index')
class App.Todo extends Batman.Model
@global(yes)
@persist(Batman.LocalStorage)
@encode('body', 'isDone')
body: ''
isDone: false
class App.TodosController extends Batman.Controller
newTodo: null
index: ->
@set('newTodo', new Todo)
@render(false)
create: =>
@newTodo.save =>
@set('newTodo', new Todo)
App.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment