title: Injecting http in a service gives "No provider for Http!" error
body: <p>Angular version: 2.0.0-beta.13</p>
  
  <p>I am trying to inject <code>http</code> into a service:</p>
  
  <pre><code>@Injectable()
  export class GithubService {
      ...
      constructor(private http: Http) {
      }
  }
  </code></pre>
  
  <p>I have listed <code>HTTP_PROVIDERS</code> as a provider in the root component of my application, so this provider should be available to any component in my application:</p>
  
  <pre><code>@Component({
    providers: [HTTP_PROVIDERS],
  })
  export class AppComponent {}
  </code></pre>
  
  <p>However when I run this application, I get the following error:</p>
  
  <blockquote>
    <p>EXCEPTION: Error: Uncaught (in promise): No provider for Http! (HttpReqComponent -> GithubService -> Http)</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I changed <code>providers</code> to <code>viewProviders</code> and the error is now gone!</p>
  
  <pre><code>@Component({
    viewProviders: [HTTP_PROVIDERS],
  })
  export class AppComponent {}
  </code></pre>
  
  <p>However, I cannot explain why this is working. <code>http</code> is not being accessed by any view directly. It is only accessed inside <code>GithubService</code>. So why do I have to declare <code>HTTP_PROVIDERS</code> as a <code>viewProvider</code>?</p>
  
  <p><strong>Edit 2</strong></p>
  
  <p>Well, I moved the <code>providers</code> declaration from AppComponent down to the component where I need it and now it works! So there must be some quirk in declaring it at the root level.</p>
  
  <pre><code>@Component({
      providers: [HTTP_PROVIDERS, GithubService],
  })
  export class HttpReqComponent { }
  </code></pre>
  
  <p>Actually, both <code>providers</code> and <code>viewProviders</code> works. Turns out that <code>viewProviders</code> is actually more restrictive and provides better encapsulation of the component. See <a href="http://blog.mgechev.com/2016/01/23/angular2-viewchildren-contentchildren-difference-viewproviders/">this article</a> for details.</p>