Search code examples
c#angularhttpclient-server

Catch server response and display it to the screen angular/c#


I am making a client/server application. When the request has been successfully received by the server it sends back "Received" to the client. The word "Received" is currently being sent to the console but I would like to display the word sent by the server on the webpage. Is there a way to grab this response and display it on the screen?


Solution

  • In the angular service, sendDetails can actually return Observable (since in C# you always return a string response). Then, in angular component, when you subscribe, the 'success' param is already the string from C#.