My code looks like this
export class AddressingService {
myVar;
protected static getUserId() {
this.myVar // property myVar doesn't exist on type 'typeof MyService'
}
}
How can I fix that
My code looks like this
export class AddressingService {
myVar;
protected static getUserId() {
this.myVar // property myVar doesn't exist on type 'typeof MyService'
}
}
How can I fix that
myVar is in scope of the class, therefore it requires an instance of your class to access it.
You can set your variable to be static like so.
export class AddressingService {
static myVar;
protected static getUserId() {
this.myVar // property myVar doesn't exist on type 'typeof MyService'
}
}