javascript - Load JSON into backbone model -
I am trying to load json files in a backbone model:
var feed = backbone.model Extension (); Var FeedCollection = Backbone.Collection.extend ({Model: Feed, url: 'feed.json' var feeds = new FeedCollection (); feeds.fetch ({Success: Work} {console.log (feeds);}}) The first log gives the JSON obect inside the file, just gives an object without JSN data.
You are overriding the parsing function and are not returning anything to add itself to the collection. parse Permission to populate it from Feedback Alternatively, return the parse to the properties you need from the server's response to define your collection.
Comments
Post a Comment