I would like to call a jsonp callback from a typescript module of devextreme.
The following code is not working.
I would like to call weatherResponse
callback, but it's inside the TypeScript module.
module tellmeweather {
export function home(params: { id: any }) {
return {
LocationValue: ko.observable("New York"),
LocationResults:ko.observable("No Results"),
goSearch: function ()
{
$.ajax({
url: 'http://api.openweathermap.org/data/2.5/weather?q='
+ this.LocationValue() + ',it&callback=weatherResponse',
dataType: 'jsonp',
jsonp: 'weatherResponse',
success: function () {
}
});
}
,
weatherResponse: function (locdata:any)
{
this.LocationResults("Location Name:"+locdata.name);
}
};
}
}