Add type to http requests instead to just the response
See original GitHub issueIn some *backend-api.service.ts
files we declare the type of response in the following way
this.http.get(...).then((response: IXyzDict) => {...});
This should be refactored to the following
this.http.get<IXyzDict>(...).then(response => {...});
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Angular 6: How to set response type as text while making http ...
Actually, responseType only allows 'json' value. Typescript knows that. So writing 'text' as 'json' means "I give you 'text' value, but for type...
Read more >How to Make Type Safe HTTP Requests in Angular | Pluralsight
First, this guide will go over a simple example of how you would use Angular's HttpClient without the expressivity of types. Here is...
Read more >HTTP request methods - MDN Web Docs
Chrome Edge
CONNECT Full support. ChromeYes. Toggle history Full support. Edge12. Toggle history
DELETE Full support. ChromeYes. Toggle history Full support. Edge12. Toggle history
GET Full...
Read more >Angular HTTP Client - QuickStart Guide
Complete Guide on Angular HTTP: Learn how to do common HTTP operations: GET, PUT, PATCH, DELETE, POST, Error Handling, Interceptors, etc.
Read more >Communicating with backend services using HTTP - Angular
Now HttpClient.get() returns an Observable of type HttpResponse rather than just the JSON data contained in the body. The component's showConfigResponse() ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@OGALI This issue is already assigned. Only one person is allowed to work on an issue to avoid efforts from getting wasted. Please pick any other issue to work on. Thanks!
Done in #10054.