グローバルセレクタでオブジェクトや要素を指定してバインドして、unbind時にバインド対象要素が参照できない時、正しくアンバインドできない。以下のようなコードで動作を確認した。
h5.core.controller('body', {
__name:'controller',
target: $('.target'),
'{this.target} click': function(){
console.log('binded!');
}
}).readyPromise.done(function(){
this.target = null; // this.targetにnullを代入
this.unbind(); // unbind
$('.target').click(); // "binded!"
});
グローバルセレクタでオブジェクトや要素を指定してバインドして、unbind時にバインド対象要素が参照できない時、正しくアンバインドできない。以下のようなコードで動作を確認した。