title: Problems with Angular 2 Http GET
body: <p>I'm struggling to do a http get request with Angular 2. I've made a file with the JSON information that I want to &quot;get&quot; with my TeacherInfo class and use it to display information by the account component which is used in a routing.</p>
  <p>If I click in the routerLink for this element nothing is displayed and if I switch to another routerLink there is neither ( there was before, all routerLinks worked just fine )</p>
  <p>file: TeacherInfo.service.ts</p>
  <pre><code>import {Injectable, OnInit} from '@angular/core';
  import { Http, Response , Headers} from '@angular/http';
  import { account } from '../components/account.component';
  import {Observable} from &quot;rxjs&quot;;
  @Injectable()
  export class TeacherInfo {
  
  
  constructor ( private http : Http) {}
  
  private url = '../test.json';
  
  getInfo(){
  
      return this.http.get(this.url)
          .toPromise()
          .then(response =&gt; response.json().data as account );
  }
  }
  </code></pre>
  <p>file: account.component.ts</p>
  <pre><code>import {Component, OnInit} from '@angular/core';
  import { TeacherInfo } from '../services/TecherInfo.service';
  
  @Component({
  template:`
      &lt;h2&gt;This is not ready jet!&lt;/h2&gt;
      &lt;p&gt;
          Willkommen {{name}}! &lt;br/&gt;
          E-mail: {{email}}&lt;br/&gt;
      &lt;/p&gt;
      `
  })
  
  export class account implements OnInit{
  
  public id : number;
  public name : string;
  public email: string;
  private acc : account;
  
  constructor(private accountinfoservice : TeacherInfo) {
  
  }
  
  getInfo() {
      this.accountinfoservice.getInfo()
          .then(( info : account )  =&gt; this.acc = info );
  
  }
  
  ngOnInit () {
      this.getInfo();
      if ( this.acc != null ) {
          this.id = this.acc.id;
          this.name = this.acc.name;
          this.email = this.acc.email;
      }else {
          console.log(&quot;there is no data! &quot;);
      }
  }
  </code></pre>
  <p>and finally test.json :</p>
  <pre><code>{
  &quot;id&quot; : &quot;1&quot;,
  &quot;name&quot;: &quot;testname&quot;,
  &quot;email&quot;: &quot;testemail&quot;
   }
  </code></pre>
  <p>I'm using the latest versions of node and npm and I get no compilation errors and just unrelated errors in the browser console ( other SPA's parts which aren't ready yet). The observable implementations are there because at first I tried to do it that way and came to the conclusion it's easier at first to use a promise.</p>