I've tried various incarnations of the following function and can't get
'this.entries' to return with any data (it's always undefined in the
console log). I'm clearly not understanding how to handle the observable
correctly and am hoping for some guidance...
...
import * as x2js from 'xml2js';
...
getPosts() {
this.parser = x2js.parseString;
this.http.get(this.url)
.map((res:Response) => {
this.parser(res);
})
.subscribe(
data => { this.entries = data },
err => console.error(err)
);
console.log("entries: ", this.entries);
}
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.