title: Angular2: extract array element form http.get response
body: <p>Angular2 is so much fun! (end of Sarcasm)</p>
  
  <p>This particular <a href="http://plnkr.co/edit/XRXeoxObVPM1CkDD2Mgb?p=preview" rel="nofollow noreferrer">plunker</a> is successful in extracting a very specific element from the array and then is able to display it into the templateUrl. Generally speaking is really easy to display data in the template. </p>
  
  <p>Unfortunately that is not my issue. What I need to do is get a value from dataService / Injectable and turn it into a variable and then pass that variable into chart program. Basically, I need something like this: 
  <code>console.log(last);</code></p>
  
  <pre><code>   //a simple json data component
     import {Component, View} from 'angular2/angular2'
     import {DataService} from './dataService'
  
     @Component({
      selector: 'my-data',
    templateUrl: 'src/template.html'
  })
  export class Data {
    constructor(dataService:DataService) {
      dataService.dataObser
        .subscribe(dataObj =&gt; {
          this.last = dataObj.person.last;
          this.dataObj = dataObj;
        });
        console.log("this is what I'm looking for " + this.last);
    }
  }
  </code></pre>
  
  <p>I will then take the variable and pass into chartData, as laid out in this <a href="https://stackoverflow.com/questions/34759946/angular-2-and-amcharts">question</a>. That is why I need capture this response from the json and turn it into a variable. I'm think this shouldn't be that difficult? </p>