Loading
 
What's Next: View All Tutorial →

Angular Js 2 - EXCEPTION: No provider for Http! & Error: DI Error

  Import HttpModule to the module where you use it (here for example the AppModule: import { HttpModule } from '@angular/http'; @NgModule({ imports: [ BrowserModule, FormsModule, // if used HttpM...

Published Date: 10/12/2016  Last Modified Date: 10/12/2016    New Post



 

Import HttpModule to the module where you use it (here for example the AppModule:

import { HttpModule } from '@angular/http';

@NgModule({
  imports: [
    BrowserModule,
    FormsModule, // if used
    HttpModule,
    JsonpModule // if used
  ],
  declarations: [ AppComponent ],
  bootstrap:    [ AppComponent ]
})
export class AppModule { }


Things to know:

HttpModule  - Should be imported in the import statement


Error: DI Error

HttpModule  - It should be added as well in the @Ngmodule import section also.

Awaiting for Administrator approval





Tags: Exception

← Back to list


Related Post




×