javascript - backbone collection undefined on sync -


For some reason my store is set to be undefined when I get it if I log the archive before fetching I actually get this:

If I log in after fetching (when the sync event is triggered) I get undefined.

View

  App.Views.Overview = Backbone.View.extend ({template: tpl.overview, tagname: "div", id: "overview", initialize : Function () {Console.log ('Starting observation'); this.collection.on ("sync reset", this.render);}, render: function () {console.log (this.collection) ; $ (This.el) .html (this.template); it returns;}});  

Archive

  app. Colections. Gardens = backbone compilation. Extension ({Model: App.Models.Garden, url: Settings.API + "/ Plant"});  

model

  App.Models.Garden = Backbone.Model.extend ({default: {id: "undefined", owner_id: "undefined", Name: "undefined", width: "undefined", height: "undefined"}});  

creation

In this way I make this scene:

  var gardens = new app.collections.Gardens ( ); Gardens.fetch (); This.overview = New app View. Overview ({archive: garden});  

Thanks advance!


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -