Skip to content

Instantly share code, notes, and snippets.

@lusentis
Created July 8, 2012 17:46
Show Gist options
  • Save lusentis/3072022 to your computer and use it in GitHub Desktop.
Save lusentis/3072022 to your computer and use it in GitHub Desktop.
define ['router', 'text!templates/document.html'], (routerjs, template_doc) ->
class Document extends routerjs.SyncModel
url: '/document/' # API end point
template: template_doc # HTML Template to render when fetching data with @get
Document.mine = (callback) ->
@req 'mine/', 'GET', {}, callback
Document.countByGroup = (callback) ->
@req 'count/', 'GET', {}, callback
return Document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment