我的代码有一个小问题。这里是 :
// We are in the constructor of my class
this.socket.emit('getmap', {name: name}, function(data){
this.mapData = data.map;
this.load();
});
问题是mapData没有设置属性,实际上this是指命名空间Socket。如何this.mapData通过此功能访问?
对不起我的英语不好......