Solution
Override initialize method of Model with following code
initialize: function(){
console.log("model initialized");
this.on("change:name", function(e){console.log( "Mr"+e.get('name'));});
}
Instantiate model and watch console. You should see console with value "Mr.Jain Sood"
person.set('name','Jain Sood'));
Override initialize method of Model with following code
initialize: function(){
console.log("model initialized");
this.on("change:name", function(e){console.log( "Mr"+e.get('name'));});
}
Instantiate model and watch console. You should see console with value "Mr.Jain Sood"
person.set('name','Jain Sood'));
No comments:
Post a Comment