In AngularSpa template, log any FetchData errors but don't stop prerendering completely

This commit is contained in:
Steve Sanderson
2017-07-06 14:57:07 +01:00
parent 721e3c45fd
commit 4ba0358987

View File

@@ -11,7 +11,7 @@ export class FetchDataComponent {
constructor(http: Http, @Inject('ORIGIN_URL') originUrl: string) { constructor(http: Http, @Inject('ORIGIN_URL') originUrl: string) {
http.get(originUrl + '/api/SampleData/WeatherForecasts').subscribe(result => { http.get(originUrl + '/api/SampleData/WeatherForecasts').subscribe(result => {
this.forecasts = result.json() as WeatherForecast[]; this.forecasts = result.json() as WeatherForecast[];
}); }, error => console.error(error));
} }
} }