Maintaining state of a component in angular

100 Views Asked by At

I have a component which uploads files to blob storage, I have side bar navigation in my app, I need a way so that if I have uploaded some files in my uploading component and went to another component without completing the files progress, when I revisit the uploading component I can still see the progress. I want let the uploading process continue even when the component is not in DOM. Is there a feasible solution for the above scenario, or do I need to create a global component for handling this.

1

There are 1 best solutions below

1
Sevvandhi Nagulan On

When you switch to another page in the sidebar component, angular routing will happen. The Router destroys a routed component while visiting the previous page. You can store the data like filesData using the angular services. But we cannot maintain the state of the uploader. Kindly refer the below link,

Reference link: https://angular.io/guide/router