You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i create a NestedModel within my models.js, anytime I attempt to update the model through code, I receive the above error. My model is instantiated like so:
varSpecial=Backbone.NestedModel.extend({initialize : function(){// Log the changed propertiesthis.on('change',function(model,options){for(variinoptions.changes)this.display();updateSession(model);});// Update session varthis.updateSession(this);},//Attributesdefaults : function(){return{"Product" : null,"ShortDescription" : null,"Category" : "food","Price" : {"Regular" : null,"Special" : null,"PercentOff" : null},"Date" : {"StartTime" : null,"EndTime" : null,"HumanTimeRange" : null},"Uses" : 0,"Tags" : [],"Contributor" : null}},//Functionsdisplay : function(property){console.log(property+': '+this.get(property));},displayAll : function(){console.log('Product: '+this.get('Product'));console.log('ShortDescription: '+this.get('ShortDescription'));console.log('Category: '+this.get('Category'));console.log('Price: {');console.log(' Regular: '+this.get('Price.Regular'));console.log(' Special: '+this.get('Price.Special'));console.log(' PercentOff: '+this.get('Price.PercentOff')+'\n}');console.log('Date: {');console.log(' StartTime: '+this.get('Date.StartTime'));console.log(' EndTime: '+this.get('Date.EndTime'));console.log(' HumanTimeRange: '+this.get('Date.HumanTimeRange')+'\n}');console.log('Uses: '+this.get('Uses'));console.log('Tags: '+this.get('Tags'));console.log('Contributor: '+this.get('Contributor'));},updateSession : function(model){Session.set('NewSpecial',model);}});// Empty special to hold user entered data pertaining to new special creationNewSpecial=newSpecial();
If i attempt to modify the contents with NewSpecial.set('Category', 'travel') I get the error. If i copy the same exact code but instantiate the model in the console, everything works fine. I'm using the backbone-nested.js as a smart package in Meteor (I packaged it myself and will upload it to Atmosphere for community use shortly).
The text was updated successfully, but these errors were encountered:
If i create a NestedModel within my models.js, anytime I attempt to update the model through code, I receive the above error. My model is instantiated like so:
If i attempt to modify the contents with
NewSpecial.set('Category', 'travel')
I get the error. If i copy the same exact code but instantiate the model in the console, everything works fine. I'm using the backbone-nested.js as a smart package in Meteor (I packaged it myself and will upload it to Atmosphere for community use shortly).The text was updated successfully, but these errors were encountered: