This is the archived documentation for Angular v5. Please visit angular.io to see documentation for the current version of Angular.

HttpClientJsonpModule

npm Package @angular/common
Module import { HttpClientJsonpModule } from '@angular/common/http';
Source common/http/src/module.ts

Overview

      
      class HttpClientJsonpModule {
}
    

Description

NgModule which enables JSONP support in HttpClient.

Without this module, Jsonp requests will reach the backend with method JSONP, where they'll be rejected.

Annotations

      
      @NgModule({
    providers: [
        JsonpClientBackend,
        { provide: JsonpCallbackContext, useFactory: jsonpCallbackContext },
        { provide: HTTP_INTERCEPTORS, useClass: JsonpInterceptor, multi: true },
    ]
})