title: Uncaught (in promise): Error: StaticInjectorError(AppModule)[employeService -> Http]:
body: <p>I am facing above mentioned error when I am using <code>Http</code> inside the constructor of my service.</p>
  
  <p>Employee service  code </p>
  
  <pre><code>import { Component } from '@angular/core'
  import { Injectable } from '@angular/core'
  import { HttpModule } from '@angular/http';
  import { Http, Response } from '@angular/http';
  import { Observable } from 'rxjs/observable';
  import 'rxjs/add/operator/map';
  
  @Injectable()
  export class employeService {
      constructor(public http: Http){ }
  
      getEmployeename(): Observable&lt;string&gt; {
          return this.http.get('http://localhost:53656/api/values/Getdata').map((resp: Response) =&gt;
              resp.json()
          );
      }
  }
  </code></pre>
  
  <p>I am calling the service directly (not from <code>app.module.ts</code> file) inside employee component as</p>
  
  <p>Employee Component code</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { employeService } from './Service/service';
  
  @Component({  
      templateUrl: './app.employee.html',
      providers: [employeService]
  })
  export class EmployeeComponent implements OnInit {
      empName: string;
  
      constructor(private empService: employeService) { }
  
      ngOnInit() {
          this.empService.getEmployeename().subscribe(empName =&gt;
              this.empName = empName
          );
      }
  }
  </code></pre>
  
  <p>And I have this error message in Console : </p>
  
  <pre><code>core.js:1598 ERROR Error: Uncaught (in promise): Error:       
  StaticInjectorError(AppModule)[employeService -&gt; Http]: 
  StaticInjectorError(Platform: core)[employeService -&gt; Http]: 
  NullInjectorError: No provider for Http!
  Error: StaticInjectorError(AppModule)[employeService -&gt; Http]: 
  StaticInjectorError(Platform: core)[employeService -&gt; Http]: 
  NullInjectorError: No provider for Http!
  at 
  </code></pre>