title: Angular HttpClient - how to access local variable into the callback method
body: <p>Ok so I have done a ton of looking around but can't seem to find an answer to this anywhere my code looks something like this.</p>
  
  <p>Basically I have a local variable I would like to access inside of the callback function from the subscribe.</p>
  
  <p>I have learned that the problem here is called closure - but how to I get around it?</p>
  
  <pre class="lang-js prettyprint-override"><code>someMethod(){
    var localVariable = 'some value';
    this.httpService.getInfo().subscribe((res) =&gt; { /*how do i access the local 
    variable here? */});
  }
  </code></pre>