title: Undefined function inside map in angular 2
body: <p>I’m working in angular2, I define in a service a function getAccountName, and in the same component I use it in extractArrayData function, like this:</p>
  
  <pre><code>private extractArrayData(response: Response): Analysis[] {
   …
        analysisList.map(analysis =&gt; {
          if (analysis.userAccess &gt;= Access.UPDATE &amp;&amp; !analysis.group) {
            this.getAccountName(analysis.accountId)
            .flatMap(name =&gt; {
                analysis.group = name;
                return this.updateAnalysis(analysis);
              })
              .subscribe((analysisUp) =&gt; console.log('analysis group from ' + analysisUp.id + ' updated'));
          }
        });
        return analysisList;
      }
  
  
  public getAccountName(accountId: number): Observable&lt;string&gt; {
      return this.http.get(apiUrl + 'api/account/name' + '/' + accountId)
        .map(response =&gt; response.json())
        .catch(this.handleError);
    }
  </code></pre>
  
  <p>But I get the error message: 
  TypeError: _this.getAccountName is not a function</p>
  
  <p>Can anyone explain this error for me</p>