Can you please explain why the button click event is not working in TypeScript?
Below is the code snippet I am referring to: https://jsfiddle.net/z4vo5u5d/238/
class Nav {
private config:object;
constructor(){
this.config = {
$navigationPanel : $('#navigationPanel ul'),
$addItems:$('#adItems')
}
}
init(){
this.attachHandlers();
}
addItems(){
alert('===')
this.config.$navigationPanel.append('<li>tens</li>')
}
attachHandlers(){
this.config.$addItems.on('click' ,this.addItems)
}
}
$(function(){
var n =new Nav();
n.init();
})
When I try to run this code on the TypeScript play website http://www.typescriptlang.org/play/
I encounter the following error message:
Property '$navigationPanel' does not exist on type 'object'.