In my Angular application, I have a file upload feature where the file upload component is a child component and the app component serves as the parent component.
The app.component.html (Parent) contains a single line of code that calls the child component like this:
<app-profile-image></app-profile-image>
I am unable to make any changes to the child component in my actual application, as it is a library and I do not have access to its code.
Here is a working example: https://stackblitz.com/edit/angular-file-upload-preview-6f4o8w
In the child component (for reference), you can see:
<h4 class="success-message" *ngIf="url"> Uploaded Successfully </h4>
This message is displayed only if the profile picture has been successfully uploaded, otherwise it does not appear..
Currently, the success message is visible only when the user hovers over the image again after uploading. This may result in users not realizing that their image was successfully uploaded unless they hover over the image once more.
So, my question is how can I display the success-message
below the profile image in the parent component (app.component
) immediately after the file is uploaded, without requiring the user to hover over the image again.
I would appreciate any guidance on how to achieve this without making any changes to the child component.