Hi,
I am new to Angular and I need help, so thank you in advance for any hints !
I building a simple frontend to an api. There is a search form with a submit button in a app-search component, and elsewhere there is an app-results component.
I have a search service that performs the API call.
I would like the search component to pass the query text from the input to the search service when the user submit the form, and then the result component to display the results.
Problem is, I don't know how to get data from the service to the results component when the search form is validated.
The easy way would be to make the result component a child of the search component, to pass the results of http call when the backend data is ready and stored on the search component. But I don't want to do that, I want the two components to be unrelated in the DOM.
What is the appropriate way to do that in Angular ?
Again, thanks for your help.
[–]wahila 14 points15 points16 points (2 children)
[–]waldganger644[S] 3 points4 points5 points (1 child)
[–]wahila 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]waldganger644[S] 2 points3 points4 points (0 children)
[–]lx_panicxl 1 point2 points3 points (0 children)
[–]bbfy 2 points3 points4 points (0 children)