I have an AuthGuard (used for routing) that implements CanActivate.
canActivate() {
return this.loginService.isLoggedIn
in canActivate(), you can return a local boolean property (default to false in your case).
private _canActivate: boolean = false;
canActivate() {
return this._canActivate;
}
And then in the result of the LoginService, you can modify the value of that property.
//...
this.loginService.login().subscribe(success => this._canActivate = true);