While trying to add a PrimeNG table I broke my build here: https://github.com/BillyCharter87/Tech-O-Dex-UI/tree/BrokeIt
I recall updating my package.json
fr
Add HttpClientModule
in your app.module.ts
and try, it will work so sure.
for example
import { HttpModule } from '@angular/http
Make sure you have imported HttpClientModule
instead of adding HttpClient
direcly to the list of providers.
See https://angular.io/guide/http#setup for more info.
The HttpClientModule
actually provides HttpClient
for you. See https://angular.io/api/common/http/HttpClientModule:
Code sample:
import { HttpClientModule, /* other http imports */ } from "@angular/common/http";
@NgModule({
// ...other declarations, providers, entryComponents, etc.
imports: [
HttpClientModule,
// ...some other imports
],
})
export class AppModule { }
import the HttpClientModule in your app.module.ts
import {HttpClientModule} from '@angular/common/http';
...
@NgModule({
...
imports: [
//other content,
HttpClientModule
]
})