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

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -