Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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,  ]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Uncaught #HttpClient
ADD COMMENT
Topic
Name
7+5 =