javascript - how to access changed attributes after fetch? backbone.js -
I am using this code to fetch models from a server:
Var id = Args.model.get ('id'); Var option = {action: 'getSubscriber', address: args.model.get ('address'), silent: true}; New Subscriber ({ID: ID}, Options) .Fatch ({Success: Function (Model, Response) {console.log (feedback); console.log (model);}}); The response contains all the data I need while the model does not store the data as its direct attribute, but as That has changed the object is wrong? Normally I use model attribute with the help of the model.get ('name') call. How do I use new features in that case? Is this the model.changed.thePropertyIwantToAccess ?
You might want to change it to change event this.model.on ('change', function () {var changedAttributes = this.model.changedAttributes (); // Processes on changed attributes}, this); Do this event in the start work of view )
Comments
Post a Comment