I have spent a considerable amount of time researching this topic, however, the tutorials and guides I've come across have varied significantly, making it difficult for me to fully understand this concept.
What I aim to accomplish is as follows:
1) Initiate a straightforward http request from our server [Using any API for illustration purposes]
2) Execute a function with data retrieved in step (1). [Removing a property from the object]
3) Utilize the result and length from step (2) to carry out a loop of $http requests to our server. [Or any server]
4) This will yield 6 distinct objects. Apply a function to these 6 objects. [Adding a property]
5) Only after completing all the aforementioned steps, execute a separate function [Logging "finished"]
How can promises be used to achieve this? How do I pass data from step (1) through a promise to step (2)? Is this the correct approach to accomplish my task?
If someone could demonstrate how this structure should be organized, it would be extremely beneficial; I have kept the functions simple for the sake of clarity in this inquiry.