I have been working on an Angular app where I used to load all data before displaying any page through the ui-router resolve
. However, I found that some data was being repeated, so I decided to cache the data using localStorage. Now I'm trying to figure out the best way to combine the cache and promises to work effectively. Should I resolve a promise in the parent component using the cache and then use that promise throughout the app? Or should I resolve a promise separately using the cache in every state? Or is it better to directly call the cacheable data within each page controller without involving resolving promises at all?
Any suggestions or hints would be greatly appreciated.