In my angular navbar
I have a *ngIf
for rather or not login/logout button should be showing
*ngIf="!authService.loggedIn()
it uses a service with this loggedIn function that returns true or false
loggedIn() {
return this.http.get('http://localhost:3000/users/validateToken')
.map(res => res.json()).map(data => data.success);
}
bu this is async, how I make my ngIf
await it ? or how can I differently get the same result ?