Simplify Angular 2 template where possible

This commit is contained in:
SteveSandersonMS
2016-09-19 12:44:25 +01:00
parent 243a9b4ef6
commit 8f550c5706
20 changed files with 77 additions and 252 deletions

View File

@@ -0,0 +1,23 @@
import { Component } from '@angular/core';
import { Http } from '@angular/http';
@Component({
selector: 'fetchdata',
template: require('./fetchdata.component.html')
})
export class FetchDataComponent {
public forecasts: WeatherForecast[];
constructor(http: Http) {
http.get('/api/SampleData/WeatherForecasts').subscribe(result => {
this.forecasts = result.json();
});
}
}
interface WeatherForecast {
dateFormatted: string;
temperatureC: number;
temperatureF: number;
summary: string;
}