Consider the following situation within Angular 6:
- There is one upload component that is being utilized twice on the same page.
- By clicking the add button on any upload component using a behavior subject, data specific to that upload component can be obtained.
- After successfully uploading the data, it is desired to return a message to the particular upload component from which the data originated.
The structure looks something like this:
MainComponent
UploadComp1 UploadComp2 //These are instances of the UploadComp
How can data be sent back from MainComponent to
- UploadComp1 when the request is initiated from UploadComp1.
- UploadComp2 when the request is initiated from UploadComp2.
In essence, there is a component used for file uploads, repeated twice on the same page. This component collects the file and sends it to the parent component for uploading.
Upon completion of the upload process, it is desired to send a message to the specific upload component from the parent component where the file originated.
Your suggestions would be greatly appreciated.
Thank you.