question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add type to http requests instead to just the response

See original GitHub issue

In 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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nishantwrpcommented, Jun 9, 2020

@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!

0reactions
nishantwrpcommented, Sep 28, 2020

Done in #10054.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found