mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Make 'fetchdata' components in templates compatible with latest TypeScript compiler
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user