this
调用回调函数时如何保持?
init: function() {
console.log( this ); // constructor, YES!
this.readConfig();
},
readConfig: function() {
console.log( this ); // constructor, YES!
this.httpApi.request({
module : 'monitor',
func : 'getConfig',
success : this.readConfigCallback,
scope : this
});
},
readConfigCallback: function(oResponse) {
console.log( this ); // Window, NO!
var oView = this.getView(); // error...
}