The new HttpClient class in Angular 4.3 seems to return Object instead of any by default.
Is there a particular reason for doing that, given the typescript documentation says:
Don’t ever use the types Number, String, Boolean, or Object. These types refer to non-primitive boxed objects that are almost never used appropriately in JavaScript code.
https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html
I'm aware that I can provide my own return type using:
this.httpService.get<any>('/api1').subscribe(Data => {console.log(Data.Value1)});
It would seem to be easier to just make it the default. I'm aware that I can create a type specific for the data it's returning, but using any seems like it'd make it more flexible.
I was going to extend the HttpClient and override the methods to return any, but before I do that I wanted to see if there was something I was missing.