親ビューと子ビューの両方のイベントを適切に登録して発火させる正しい方法は何ですか?
このアプローチでは、親のイベントが子供のイベントを一掃します。また、子のイベントを の一部として親に渡し、登録する前に親にそれらを拡張させようとしましたoptions
が、親のイベントは機能しなくなりました。
親
// this is helpers/authorization/views/authHelper
export class AuthView extends Backbone.View {
constructor(options?) {
this.events = {
'keypress #auth': 'setAuthorizationCodeKeypress',
'click .create': 'setAuthorizationCode'
};
super(options);
}
}
子
import AV = module("helpers/authorization/views/authHelper")
export class PageHelperView extends AV.AuthView {
constructor(options?) {
this.events = {
'click .configHead': 'toggle'
}
super(options);
}
}
それらが同じ要素を共有し、new EHV.EncoderAPIHelperView().render();
それらをレンダリングするための呼び出しのみを必要とすることを望みます。