mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
24 lines
1,023 B
Markdown
24 lines
1,023 B
Markdown
|
|
@name JSONP support in HttpClient configuration
|
||
|
|
@category runtime
|
||
|
|
@shortDescription Missing JSONP support in HttpClient configuration
|
||
|
|
|
||
|
|
@description
|
||
|
|
Angular produces this error when you attempt a `JSONP` request without providing the necessary support for it in the `HttpClient` configuration.
|
||
|
|
To enable `JSONP` support, you can do one of the following:
|
||
|
|
- add the `withJsonpSupport()` as an argument during the `provideHttpClient` function call (e.g. `provideHttpClient(withJsonpSupport())`) when `bootstrapApplication` is used
|
||
|
|
- import the `HttpClientJsonpModule` in your root AppModule, when NgModule-based bootstrap is used.
|
||
|
|
|
||
|
|
|
||
|
|
@debugging
|
||
|
|
Make sure that the JSONP support is added into your application either by calling the `withJsonpSupport()` function (when the `provideHttpClient()` is used) or importing the `HttpClientJsonpModule` module as described above.
|
||
|
|
|
||
|
|
See [Make a JSONP request](/guide/http-make-jsonp-request) for more info.
|
||
|
|
|
||
|
|
<!-- links -->
|
||
|
|
|
||
|
|
<!-- external links -->
|
||
|
|
|
||
|
|
<!-- end links -->
|
||
|
|
|
||
|
|
@reviewed 2023-05-02
|