title: How to access elements of json in Angular 2
body: <p>when I did</p>
  
  <pre><code>loadPeople(){
  
      this.myService.load().then(data =&gt; {
              this.people = data;
              alert(this.people);
          });
      }
  </code></pre>
  
  <p>it alerts json as :</p>
  
  <pre><code> {
  "status": "true",
  "statusCode": 200,
  "response": [{
      "user_id": "92",
      "firstname": "joy",
      "lastname": "Panchal",
      "email": "joy@gmail.com",
      "password": "7Y7+K0vZIVWPDUQH++Iu+/+tMZ",
      "user_type_id": "1"
  }, {
      "user_id": "89",
      "firstname": "mark",
      "lastname": "haris",
      "email": "mark@gmail.com",
      "password": "4JICqnTkR8ysTI+nQQ+rpfAf7e",
      "user_type_id": "1"
  }]
  </code></pre>
  
  <p>}</p>
  
  <p>now i am trying to access "response" by </p>
  
  <pre><code>loadPeople(){
  
  this.myService.load().then(data =&gt; {
          this.people = data.response;
          alert(this.people);
      });
  }
  </code></pre>
  
  <p>but it alerts as "undefined" .</p>
  
  <p>can anyone tell where i am missing ??</p>