I am trying to eliminate the use of <any>
in my TypeScript AngularJS code. Can anyone suggest which class type should be used for handling the $http response in methods like get/post?
For example, I would prefer to replace <any>
with a specific class type in the following code snippet:
search() {
this.$http.get('https://maps.googleapis.com/maps/api/geocode/json', {params: {address: this.$scope.searchTerm}})
.success((response: any) => {
this.$scope.results = response.results;
}).error((response: any) => {
console.error("Error calling the server");
});
};
P.S.:
this.$scope = MyScopeInterface and this.$scope.results = google.maps.GeocoderResult