Make 'fetchdata' components in templates compatible with latest TypeScript compiler

This commit is contained in:
SteveSandersonMS
2016-11-29 19:10:48 +00:00
parent a8d3eed32c
commit 62c0680193
5 changed files with 9 additions and 9 deletions

View File

@@ -13,8 +13,8 @@ class FetchDataViewModel {
constructor() {
fetch('/api/SampleData/WeatherForecasts')
.then(response => response.json())
.then((data: WeatherForecast[]) => {
.then(response => response.json() as Promise<WeatherForecast[]>)
.then(data => {
this.forecasts(data);
});
}