私は次のようなビューモデルを持っています:
CANVAS = getElementById...
RemixView = function(attrs) {
this.model = attrs.model;
this.dragging = false;
this.init();
};
RemixView.prototype = {
init: function() {
CANVAS.addEventListener("click", this.handleClick);
},
handleClick: function(ev) {
var obj = this.getHoveredObject(ev);
},
getHoveredObject: function(ev) {}
...
...
}
rv = new RemixView()
問題は、 clickHandler イベントが発生したときです。このオブジェクトはRemixView ではなくCANVASオブジェクトと同じです。したがって、次のようなエラーが表示されます。
this.getHoveredObject は関数ではありません
その状況での正しいアプローチは何ですか?