Typescript “this” inside a class method
If you want this captured the TypeScript way of doing this is via arrow functions. To quote Anders: The this in arrow functions is lexically scoped Here is the way I like to use this to my advantage: class test{ // Use arrow functions func1=(arg:string)=>{ return arg+” yeah” + this.prop; } func2=(arg:number)=>{ return arg+10 + … Read more