Yes the problem is that you need to bind this
like so: addEventListener(this.checkChange.bind(this))
Because you dont this
is effectively undefined inside your checkChange
method. It takes a little bit to get used to coming from C#
Yes the problem is that you need to bind this
like so: addEventListener(this.checkChange.bind(this))
Because you dont this
is effectively undefined inside your checkChange
method. It takes a little bit to get used to coming from C#
That is a javascript thing: JavaScript Function bind() Method or Function binding
Thank you so much! I’m totally new to this. It feels like my early days with C#, scratching my head…
by user 732122195614105653
You’ll get used to it
You’re not alone either Fred
by user 563549194137239552
no just overlooking comments with TS in the docs is a tricky learning
by user 334342083445784576