Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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