I have a project in Node JS
and Typescript
in which I am trying to share variables between classes within the same file.
This is the class
I want to get the max
variable from:
export class constUt {
env: string;
max: number;
constructor() {
this.env = 'dev';
this.max = 100;
}
}
This is the class I'm trying to pick up the max
variable in:
export class callBack {
private utilsCo = new constUt();
call = function (err:any, csv:any) {
console.log(`max constUt: ${this.utilsCo.max}`); //error
if (err) throw err;
}
}
My problem is that I don't know how to read the max
variable inside the call
function