Skip to content

Instantly share code, notes, and snippets.

@nhajratw
Created January 24, 2012 13:56
Show Gist options
  • 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