ngmodule
Configures the dependency injector for HttpClient
with supporting services for JSONP. Without this module, Jsonp requests reach the backend with method JSONP, where they are rejected.
class HttpClientJsonpModule { }
You can add interceptors to the chain behind HttpClient
by binding them to the multiprovider for built-in DI token HTTP_INTERCEPTORS
.
Provider |
---|
JsonpClientBackend |
{ provide: JsonpCallbackContext, useFactory: jsonpCallbackContext } |
{ provide: HTTP_INTERCEPTORS, useClass: JsonpInterceptor, multi: true } |
© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v11.angular.io/api/common/http/HttpClientJsonpModule