I'm trying to bind change event to model, but is not working. Here is the link: http://jsfiddle.net/kahhor/jp4B6/2/ . I think, I'm doing some stupid mistake, that I cannot figure out.
I think the problem is that it is two different views...
Sorry, new in backbone.js, just learning :)
Thanks,
update: I changed the way I call views and models:
/* MODELS */
var PopupM = new PopupModel();
var TaskbarM = new TaskbarModel();
var LeftNotificationM = new LeftNotificationModel();
/* /MODELS */
window.PopupView = new PopupView({model: PopupM, LeftNotificationModel: LeftNotificationM});
window.TaskbarView = new TaskbarView({model: TaskbarM});
window.TaskbarView.loadTaskbar();
window.LeftNotificationView = new LeftNotificationView({model: LeftNotificationM});
window.LeftNotificationView.loadLeftNotification();
Everything works fine, except when I'm calling decrementNotification()
this error message shows in Firebug:
this.LeftNotificationModel is undefined
this.LeftNotificationModel.decrementNotification();
But I already declared it here:
window.PopupView = new PopupView({model: PopupM, LeftNotificationModel: LeftNotificationM});
What I'm doing wrong here? :(