What does this query string do when searching for names?
this.http.get<Hero[]>(`${this.heroesUrl}/?name=${term}`)
I don't understand the meaning of this query string in the image below.
typescript angular
In conclusion, I don't know how the HttpClientInMemoryWebApiModule actually handles the request (sorry if it's written somewhere) so that learners don't have to prepare a backend server to proceed.
Read the English comments above the HttpClientInMemoryWebApiModule in app.module.ts.
// The HttpClientInMemoryWebApiModule module intercepts HTTP requests
// and returns simulated server responses.
// Remove it when a real server is ready to receive requests.
HttpClientInMemoryWebApiModule.forRoot(
InMemoryDataService, {dataEncapsulation:false}
)
Remove it when a real server is ready to receive requests.
The actual web application requires a back-end server to return a response to the front-end HTTP requests from the front end.You must include what information you want in your HTTP request in order to return a response for each user.The query parameters for GET requests are one of the methods.
I don't know if it's an answer, but I hope I can be of help.Good luck with your studies!
© 2024 OneMinuteCode. All rights reserved.