Angular2 no provider for http
Angular2 no provider for http– Sometimes while working with http service in angular 2 we face issue related to http provider in Angular 2. You need to import HttpModule before using, if it is not imported properly then it can create an issue. Here in this solution we are going to explain the possible reason and fix it.
Angular2 no provider for http Error | Quick Fix
Import the HttpModule before using, it can be imported simply as below-
Angular2 no provider for http Error: port the HttpModule
import { HttpModule } from '@angular/http'; @NgModule({ imports: [ HttpModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { } |
If you have imported the http module as above then it should fix your problem. Hope this solution will work for you.
Advertisements