Ao inserir o módulo Http, o navegador trava e não carrega mais nada.
//app.module.ts
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {AppComponent} from './app.component';
import {FotoModule} from './foto/foto.module';
import {HttpModule} from '@angular/http';
import 'rxjs/add/operator/map';
@NgModule({
imports: [BrowserModule, FotoModule, HttpModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {}
//app.component.ts
import {Component, Inject} from '@angular/core';
import {Http} from '@angular/http';
@Component({
moduleId: module.id,
selector: 'app',
templateUrl: './app/app.component.html'
})
export class AppComponent{
fotos: Object[] = [];
constructor(http: Http){
http.get('v1/fotos')
.map(response => response.json())
.subscribe(
fotos => this.fotos = fotos,
error => console.log(error)
)
}
}