In typescript, I can write something like this:
$('#something').fadeOut(400, (): void => {
this.invokeAnotherMethod();
});
When compiled, TypeScript automatically makes sure this points to my class instead of the enclosed function:
var _this = this;
$('#something').fadeOut(400, function() {
_this.invokeAnotherMethod();
});
However, what about when I need to access the real this instead of the outer _this? Is there syntax to reference it? For example, how could I write code that would compile to the following:
var _this = this;
$('#something').fadeOut(400, function() {
$(this).data('specialhide', true);
_this.invokeAnotherMethod();
});
Is it possible?