fix(http): Fix error message when we call jsonp without importing HttpClientJsonpModule (#38756)
Currently, when we call jsonp method without importing HttpClientJsonpModule, an error message appears saying 'Attempted to construct Jsonp request without JsonpClientModule installed.' instance of 'Attempted to construct Jsonp request without HttpClientJsonpModule installed.' PR Close #38756
This commit is contained in:
parent
2d6105a784
commit
88d7bb8386
|
@ -79,9 +79,10 @@ export class HttpXhrBackend implements HttpBackend {
|
||||||
*/
|
*/
|
||||||
handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {
|
handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {
|
||||||
// Quick check to give a better error message when a user attempts to use
|
// Quick check to give a better error message when a user attempts to use
|
||||||
// HttpClient.jsonp() without installing the JsonpClientModule
|
// HttpClient.jsonp() without installing the HttpClientJsonpModule
|
||||||
if (req.method === 'JSONP') {
|
if (req.method === 'JSONP') {
|
||||||
throw new Error(`Attempted to construct Jsonp request without JsonpClientModule installed.`);
|
throw new Error(
|
||||||
|
`Attempted to construct Jsonp request without HttpClientJsonpModule installed.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Everything happens on Observable subscription.
|
// Everything happens on Observable subscription.
|
||||||
|
|
Loading…
Reference in New Issue