title: Angular 2 - get datas from a json file
body: <p>How can I get my datas from a JSON in an angular 2 project? I tried (code below) but this doesn't work. Maybe I forgot some details... thanks a lot for an answer </p>
  
  <p>Ps. I need to display on my html that "uno" included in json file.</p>
  
  <p>app.component.ts:</p>
  
  <pre><code>     import { Component } from '@angular/core';
       import {Http} from '@angular/http';
  
      @Component({
          selector: 'app-header',
          templateUrl: '../partials/app.header.html',
          styleUrls: ['../css/partials/app.header.css']
      })
          export class AppComponent {
            title = 'app works!';
            data;
            constructor(private http:Http) {
                  this.http.get('app/header.json')
                 .subscribe(res =&gt; this.data = res.json());
            }
          }
  </code></pre>
  
  <p>app.module.ts:</p>
  
  <pre><code>    import { BrowserModule } from '@angular/platform-browser';
      import { NgModule } from '@angular/core';
      import { FormsModule } from '@angular/forms';
      import { HttpModule } from '@angular/http';
      import { AppComponent } from './app.component';
  
      @NgModule({
        declarations: [
          AppComponent
        ],
        imports: [
          BrowserModule,
          FormsModule,
          HttpModule
        ],
        providers: [],
        bootstrap: [AppComponent]
      })
      export class AppModule { }
  </code></pre>
  
  <p>app.header.html:</p>
  
  <pre><code>&lt;header&gt;
      {{title}}//this works
      {{elemento}}//here i want to show "uno" included in json file
      ...
  &lt;/header&gt;
  </code></pre>
  
  <p>header.json:</p>
  
  <pre><code>    {
          "elemento": "uno" 
      }
  </code></pre>