Hello,
I have a problem since yesterday and i can’t resolve it… i hope you can help me
here is my function :
getText(){
var text;
this.http.get(’…/…/data/dataTest.txt’)
.map(res => res.text())
.subscribe(
data => text = data,
err => alert(“erreur”)
);
console.log(text)
}
and it say that my variable text is undefined, or if i print it like : data => console.log(data), i can see all my text.
if someone can help me thx a lot