If you declare a return type, then why not return anything?
This is usually what you want in this case.
getGallery(username: string) : Observable<Gallery> {
return this._http.get("https://www.instagram.com/"+username+"/media/").map(res => res.json());
}
var resultprobably not the way you expect, because it _http.get(...)returns Observableno value.
Then the caller getGallery()can sign up to receive a notification when a value arrives.
instagramService.getGallery.subscribe((result) => this.galleryData = result);
, (result) => this.galleryData = result, result galleryData .