Description
Latest templates for Angular 2+ use HttpClient instead of Http. Which is great. But the import is still referencing the wrong module, which makes the import useless:
|
imports: [ CommonModule, HttpModule ], |
// OLD
import { HttpModule } from '@angular/http'
@NgModule({
imports: [ CommonModule, HttpModule ],
}
should be:
// NEW
import { HttpClientModule } from '@angular/common/http';
@NgModule({
imports: [ CommonModule, HttpClientModule ],
}