141
rated 0 times
[
142]
[
1]
/ answers: 1 / hits: 21848
/ 7 Years ago, mon, june 19, 2017, 12:00:00
Hi this is my (shortcuted) example code:
export class SolarSystemInfo {
constructor() {
this.test();
}
// click on solar system
clickSolarSystem() {
$(body).on(click,.hex, function() {
this.test();
});
}
public test () {
alert('test');
}
}
My problem is, that in constructor is test function called right, but in clickSolarSystem function after calling this.test() I get: Uncaught TypeError: this.test is not a function
How I have to call test function in my function inner class?
Thanks
More From » typescript