Angular: Best practice to hold data on reload in dumb component?

Published

the following setup is given:
I have a simple master detail pattern. The master component pulls data from a REST API and passes the result to a detail component via input decorator.

If I reload the detail component, I lose all the data and end up with a content-empty page.

It seems wrong to me to implement some sort of fallback into the dumb component to reobtain the data from the REST API if necessary.
Are there any caching possibilities?
Should I just consider a redirect to the master component?

What is the best practice to keep data/handle missing data in a dumb component when reloading the page?

Source: Angular Questions

Published
Categorized as angular, components, refresh, reload Tagged , , ,

Answers

yes you can use a subject or behavior subject – this keeps the data in the cache, you can also choose to store the data in the browser. if you let me know which you would prefer I can help you further.


Arnold Schaefer Jr.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq