title: Angular 2 _this is undefined
body: <p>I'm getting an error in the function call below saying that this.albumDetails is undefined for a specific line even though all other this calls are working fine.</p>
  
  <p>the error is: TypeError: _this.albumDetails is undefined</p>
  
  <p>The error probably occurs at this.albumDetails.concat(items) where items is an array of json objects</p>
  
  <p>Any assistance is appreciated thanks.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export class AppComponent {
  albums: any[];
  albumDetails: any[];
  searchAlbum(input: any){
      this.show = true;
      this.searchService.getAlbum(input).subscribe(data =&gt; {
        this.albums = data;
        for(var i = 0; i &lt; 50; i++){
          this.searchService.getDetails(this.albums[i].artist, this.albums[i].name, this.albums[i].mbid).subscribe(items =&gt; {
            this.albumDetails = this.albumDetails.concat(items); //Error occuring here at this.albumDetails.concat(items)
            console.log(this.albumDetails);
          });
        }
      });
    }
   }</code></pre>
  </div>
  </div>
  </p>