Closed infacq closed 10 years ago
Bind render to the view instance http://underscorejs.org/#bind
var sempurna = _.after(array_obj.length, _.bind(this.render, this))
thanks @megawac . If you dont mind, the this.render
seems would not run the if
condition set in the template. Do you have any idea?
@infacq I don't understand the question, ping me on irc (I'm in #documentcloud on freenode) and I'll see if I can help you
On another note, would it be worth changing the accepted parameters for _.after
(similarly for _.defer
, etc) to
function(n, callback, context) {
callback = createCallback(callback, context);
//...
}
i have extend this function inside Backbone.view
And so I thought that I could render the view straight away the loop is completed. But somehow the
this
keyword is refering towindow
instead of the view. How do I point to the intendedthis
to view.