backbone.js - this that pass inside object as parameter to Backbone View : "window" or "backbone view" object? -
the code:
var appointment = backbone.model.extend({}); var appointment = new appointment(); appointment.set('title', 'my knee hurts'); var appointmentview = backbone.view.extend({ render: function(){ $(this.el).html('<li>' + this.model.get('title') + '</li>'); } });
question that: $(this.el)... looks "this" "window" object , not event object?
please if can expain how working.
thanks, yosef
in backbone.js views this
bound view object, not window. can access event object if needed , through there reference target element. have @ question more information.
Comments
Post a Comment