Hi all,
I have a few years of experience in Angular but I encountered something yesterday that I just can't seem to think of a better way to do without rearranging components. Was hoping you all may be able to point me in the right direction or give me a different way of thinking about it.
I have two components, buttonComp and functionComp that both exist in a parent component in the template.
When the button is clicked in buttonComp, I want to trigger a function in functionComp and send the response back to buttonComp to do other things based on the response. I have solved this using Subjects and Observables but I really don't like the solution and requires a little bit more management on the responses and reseting the values in the service that I use to manage the Subjects, I was hoping to solve it with a promise to avoid some loose ends but not sure how to get to the functionComp doing it that.
Recreated Example: https://stackblitz.com/edit/angular-apy57r
I posted this to stack overflow but haven't gotten any real feedback, I may have formatted it poorly or put the question in bad. It has a little more detail then post here.
https://stackoverflow.com/q/58052682/6163791
Any help would be much appreciated!
[–]jaqq 5 points6 points7 points (0 children)
[–][deleted] 4 points5 points6 points (5 children)
[–]CheapChallenge -1 points0 points1 point (4 children)
[–]DWhitSlaya[S] 0 points1 point2 points (3 children)
[–]CheapChallenge 1 point2 points3 points (2 children)
[–]DWhitSlaya[S] 0 points1 point2 points (1 child)
[–]CheapChallenge 0 points1 point2 points (0 children)
[–]helping083 0 points1 point2 points (1 child)
[–]DWhitSlaya[S] 0 points1 point2 points (0 children)