Answers for "Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[HttpClient -> HttpClient -> HttpClient]:"

1

Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[HttpClient -> HttpClient -> HttpClient]:

To resolve this problem HttpClient is Angular's mechanism for communicating with a remote server over HTTP.
To make HttpClient available everywhere in the app,

1- open the root AppModule,
2- import the HttpClientModule from @angular/common/http,
  
import { HttpClientModule } from '@angular/common/http';

3- add it to the @NgModule.imports array.

imports:[HttpClientModule,  ]
Posted by: Guest on March-02-2022

Code answers related to "Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[HttpClient -> HttpClient -> HttpClient]:"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language