title: Angular 2 - how to fill a local variable with JSON data from an external file
body: <p>The Angular 2 tutorials I have read place variables directly in the app.component.ts file. For example <code>var BAR</code> below, which pulls data though the <code>{Foo}</code> interface.</p>
  
  <pre><code>import {Component} from 'angular2/core';
  import {Foo} from './foo';
  
  @Component({
     etc.
  });
  
  export class AppComponent {
     bar = BAR;
  }
  
  var BAR: Foo[] = [
     { 'id': 1 },
     { 'id': 2 }
  ];
  </code></pre>
  
  <p>However, I have the data for BAR in a local JSON file. I don't believe {HTTP_PROVIDER} is necessary. How would I go about getting the JSON data from the external file?</p>