title: Angular 2 read JSON via HTTP
body: <p>I'm new to Angular 2 and javascript in general and I'm trying to read some JSON via HTTP-request. I'm following this tutorial: <a href="https://medium.com/google-developer-experts/angular-2-introduction-to-new-http-module-1278499db2a0" rel="nofollow noreferrer">https://medium.com/google-developer-experts/angular-2-introduction-to-new-http-module-1278499db2a0</a></p>
  
  <p>I am trying to run this example using <strong>Electron.</strong></p>
  
  <p>I had to make some minor changes to source code in order to get no errors when running <code>npm run build</code> like change:</p>
  
  <p><code>&lt;my-person *ng-for="#person of people"</code> </p>
  
  <p>to</p>
  
  <p><code>&lt;my-person *ngFor="let person of people"</code></p>
  
  <p>etc. After I made these minor changes, I got it built with no errors and then ran with <code>npm run electron</code></p>
  
  <p>And here comes the problem; nothing really shows up in the view and I have no idea why not. If I activate <strong>Chrome DevTools</strong> with adding <code>win.openDevTools();</code> to main.js I can get console open and see that constructor of class App prints "completed" to console, so it would seem like everything is going right in the background but for some reason nothing shows up in the view. </p>
  
  <p><a href="https://i.stack.imgur.com/NQmcZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NQmcZ.png" alt="mainview"></a></p>
  
  <p>If I change </p>
  
  <pre><code>export class App {
    people : any;
    constructor(peopleService:PeopleService) {
      peopleService.people
          .subscribe(
              people =&gt; this.people = people,
              error =&gt; console.error('Error: ' + error),
              () =&gt; console.log('completed!')
          );
    }
  </code></pre>
  
  <p>to</p>
  
  <pre><code>..
  () =&gt; console.log('this.people')
  ..
  </code></pre>
  
  <p>I can see object printed in the console containing all three people, which are defined in <code>people.json</code> like this</p>
  
  <pre><code>[
    {"id": 1, "name": "Brad"},
    {"id": 2, "name": "Jules"},
    {"id": 3, "name": "Jeff"}
  ]
  </code></pre>
  
  <p>You can see whole project in my GitHub here: <a href="https://github.com/MikPak/ngNews" rel="nofollow noreferrer">https://github.com/MikPak/ngNews</a></p>
  
  <p>Please help me with this one to get things started. 
  Later on I would like to fetch JSON-data (news) from external server and display them in the view but I have to get this solved first.</p>