When I refresh my web-app, I want it to request the potential signed in user's data before instantiating any components or routes. If the user's data was found, I want to inject it into a service, which all my other sub components depend on.
Scenario: Say I have 3 components, App (ROOT), Home & About. If I place this code in my About component, I expect it to wait 20seconds before it instantiate, instead, the component gets instantiated instantly, only when I move away from this component, it triggers the function and I wait 20 sec to reach Home.
routerOnActivate(next: ComponentInstruction, prev: ComponentInstruction) {
return new Promise((res, rej) => {
setTimeout(function () {
res(true);
}, 20000)
})
}
Ideally I don't want the resolve to be connected to any route, I want the request the resolve in the root component before I even instantiate any routes.