Sorry I didn't get it yet....

I have one function (authenticationService.isLoginNecessary():
Observable<boolean>) ) which returns from server if logging in is necessary
and another method authenticationService.isUserLoggedIn(): boolean   which
checks local storage for an already logged in user.

1. If login is necessary I only want to return true,
2. if user is already logged in, I only want to return true,
3. if login is necessary and user is not yet logged in, I want to return
false and want to redirect to login.

So I don't yet how to combine these two things (Observable<boolean> and
boolean) to get it working

Would be nice, if you can show me how to do this.
Thanks in advance

Cheers
Markus

Am Fr., 17. Aug. 2018 um 21:10 Uhr schrieb Sander Elias <
[email protected]>:

> Hi Markus,
>
> canActivate supports async out of the box. you can return a promise or
> observable from it.
>
> Regards
> Sander
>
> --
> You received this message because you are subscribed to the Google Groups
> "Angular and AngularJS discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Markus Oley
Hch. Taubenreuther Str. 25
95361 Kulmbach
Tel:    0 92 21 / 87 78 88
Mobil: 01 52 / 23 67 63 10

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to