Closed bohdaq closed 7 years ago
@bohdaq One technique is to use a module bundler that does code-splitting (e.g. webpack) and split your bundles based on the routes set in your app. Then use <link rel="preload">
to load your route-specific bundles.
ty jmalonzo!
going to try now
jmalonzo is there a possibility to change the location and let the router omit this one specific change?
How do you mean?
For example my window.location.pathname is "/new"
I need to change it to "/task/1" without router refresh the view.
My configuration:
<app-router mode="pushstate" on-state-change="highlightMenu" app-type="internal">
<app-route path="/task/:key" element="dynamic-task-view"></app-route>
<app-route path="/new" element="start-new-workflow-categories"></app-route>
</app-router>
Looks like I found the way using history.replaceState
Thanks!
@bohdaq You'd need to ensure that when you click on a link that goes to a route (e.g. <a href="/new">
), the browser won't trigger a "refresh". You can use pushstate or pushstate-anchor (https://github.com/erikringsmuth/pushstate-anchor).
t- timing 👍
Hey,
How can I preload the route, before user clicks on link?
Thanks!