Эй, кто-нибудь может сказать мне, как я могу получить доступ к переменной компонента в цикле foreach? Вот мой Плункер
public testVariable:number;
test(){
console.log('fired');
var x =[1,2,3,4];
x.forEach(function (e){
this.testVariable = e;
})
console.log( this.testVariable);
}