I'm having a bit of trouble because when implementing guards, I have the following (pseudocode):
canActivate(
route, state, etc....{
checkStatus()
if(status){
result = false
etc
}
)
The problem is that checkStatus() is asynchronous, but I need the result in order to decide wether return true or false to the guard. I've been looking to similar questions and the answer usually is to use Promises, but I still don't know how to use those within this canActivate() function. Any help please?
Thanks.
UPDATE:
I discovered that since the checkStatus() function is async and treated as a promise, I can just use checkStatus().then(status and if and everything).
Thanks a lot either way.