The HTTP module

To get started with using HTTP in your components, you need to install the HttpModule that provides it in your application module. First, import the module:

import { HttpModule } from '@angular/http';

Next, you include the module in the array of imports registered in your application, right after BrowserModule:

// app.module.ts@NgModule({imports: [BrowserModule,HttpModule,],})

Get TypeScript 2.x for Angular Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.