I have a simple JavaScript code which using Ajax. I want translate this ajax query to TypeScript for more object oriented view. With class and method and hard data types (similar to Java:-).
Help me translate if it posible:
$(document).ready(function() {
$('#my-viewscope').click(function() {
$ajax({
url: 'get_data_servlet',
type: 'post',
dataType: 'json',
success: function(response) {
$.each(response, function(key, value) {
console.log(value);
});
}
})
})
});