I have created a service :
@Injectable()
export class AppService {
constructor(private _convertor: Convertor)
foo() {
a = ["1", "2", "3"]
return a.map(this.blah)
}
blah(s: string): number {
return this_.convertor.parseInt(s)
}
}
However, it keeps saying that this isn't defined. I replaced my map with a for, and it worked just fine. I also tried to use _.map which gave me the same result.
Any idea how to specify to the map what this it is supposed to use ?