Angular2 Resolve before CanActivate : <p>I have an Authentication service that implements the Resolve interface to return an observable that is resolved once a user's authentication state is retrieved from the server. </p>

<p>This same authentication service implements the CanActivate interface to block users from accessing a component if they are not logged in.</p>

<p>Currently, the canActivate function is triggered before the resolve function is resolved, meaning it checks the user's login state before the login state has been retrieved from the server.</p>

<p>My question is, how can I prevent the canActivate function being called until resolve is resolved, or otherwise is there another way I can achieve what I want?</p>

<p>Thanks
Max.</p>
