Skip to content

Commit 3902ec0

Browse files
wKozamhevery
authored andcommitted
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
1 parent 6f579b2 commit 3902ec0

File tree

1 file changed

+3
-2
lines changed
  • packages/common/http/src

1 file changed

+3
-2
lines changed

packages/common/http/src/xhr.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ export class HttpXhrBackend implements HttpBackend {
7979
*/
8080
handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {
8181
// Quick check to give a better error message when a user attempts to use
82-
// HttpClient.jsonp() without installing the JsonpClientModule
82+
// HttpClient.jsonp() without installing the HttpClientJsonpModule
8383
if (req.method === 'JSONP') {
84-
throw new Error(`Attempted to construct Jsonp request without JsonpClientModule installed.`);
84+
throw new Error(
85+
`Attempted to construct Jsonp request without HttpClientJsonpModule installed.`);
8586
}
8687

8788
// Everything happens on Observable subscription.

0 commit comments

Comments
 (0)