From 88d7bb838607622c48488a828286c54fe091d8f0 Mon Sep 17 00:00:00 2001 From: William Koza Date: Wed, 9 Sep 2020 13:03:01 +0200 Subject: [PATCH] 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 --- packages/common/http/src/xhr.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/common/http/src/xhr.ts b/packages/common/http/src/xhr.ts index 11e0fd544e..1dc006a463 100644 --- a/packages/common/http/src/xhr.ts +++ b/packages/common/http/src/xhr.ts @@ -79,9 +79,10 @@ export class HttpXhrBackend implements HttpBackend { */ handle(req: HttpRequest): Observable> { // 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') { - 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.