Skip to content

Instantly share code, notes, and snippets.

@nhajratw
Created January 24, 2012 13:56
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 nhajratw/1670278 to your computer and use it in GitHub Desktop.
Save nhajratw/1670278 to your computer and use it in GitHub Desktop.
Example of converting XML to JSON in a Backbone/CoffeeScript using JATH
class OE.Offer extends Backbone.Model
class OE.Offers extends Backbone.Collection
model: OE.Offer
url: 'http://localhost:7000/offer/opportunities/merchant/123'
parse: (response) ->
template = ["//offer", {
id: 'id',
name: 'name',
code: 'code'
}]
Jath.parse(template, response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment