// begin signals
this.loginSignal
this.init = function(){
// init signals
this.loginSignal = new t.store.helpers.Signal;
// map events
$('[value]="login"', this.node).click(this.login)
}
this.login = function(){
// this will dispatch an event that will be catched by the controller
// but this is not refering to this class
// and the next line fails :s
this.loginSignal.dispatch();
}
, чтобы заставить его работать сейчас, я должен добавить
var $this = this;
эту строку и использовать $this
вместо this
: S
какой-нибудь более понятный способ?спасибо