我是Typescript的新手,我试图在Typescript中创建状态机。 我不确定我的语法是否正确,但是却出现此错误: 类型“ HTMLElement”上不存在“属性”商店
类测试{
private $componentSelector: JQuery;
private $radioButtons: JQuery;
private store: Object;
constructor($theComponentSelector: JQuery) {
this.$componentSelector = $theComponentSelector;
this.$radioButtons = this.$componentSelector.find('.radio-button');
this.store = {
selectionType: ''
}
this.test();
}
test() {
this.$radioButtons.on('click',function(){
this.store.selctionType = $(this).val();
});
}
}