When I update my web application, I want it to request the potential, signed in the user data, before creating any components or routes. If user data was found, I want to enter it into the service on which all my other supporting components depend.
Scenario: let's say I have 3 components, an application (ROOT), home and more. If I put this code in my About component, I expect it to wait 20 seconds before it instantiates, instead the component will be instantly created, only when I leave this component, it calls the function, and I wait 20 seconds to get home.
routerOnActivate(next: ComponentInstruction, prev: ComponentInstruction) { return new Promise((res, rej) => { setTimeout(function () { res(true); }, 20000) }) }
Ideally, I do not want the solution to be connected to any route, I want the request to be resolved in the root component before I even create any routes.
source share