import { NgModule, Injectable, Component } from '@angular/core'; import { HttpModule, Http } from '@angular/http'; import { BrowserModule } from '@angular/platform-browser'; @Component({ selector: 'app-home', template: `

Hola

` }) export class HomeComponent { constructor(private http : Http) { console.log('Http is injected ok: ' + http) } } @NgModule({ imports: [ BrowserModule, HttpModule ], declarations: [ HomeComponent ], bootstrap: [ HomeComponent ], entryComponents: [ ], providers: [ ] }) export class AppModule2 { }