angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

Add pre-fetching of states to the router #3643

Closed euangoddard closed 4 years ago

euangoddard commented 6 years ago

This is a (check one box):

My version of UI-Router is: 1.0.0-rc.3

Feature Request

It would great to be able to signal the router to pre-fetch a state. Currently I would like to have all the resolves for a specified state run in the background so that all dependent resources are fetched from the backend to speed up the next transition (API requests are cached by service worker).

At the moment I'm investigating triggering a transition and using a hook to abort it right at the last minute which seems like a hack to achieve an imperative running of all resolves.

I'd be happy to submit a PR if you could point me in the location where I could achieve this.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues may be reopened.

Thank you for your contributions.