0
I have a menu in the app-Component and need to update the Islogged variable after user login so that the menu appears correct after login successfully.
<ion-item routerLink="home" *ngIf="!IsLogged">
<ion-icon slot="start" name="log-in-outline"></ion-icon>
<ion-label>{{'sidemenu.signin' | transloco}}</ion-label>
</ion-item>
<ion-item (click)="DoLogOut()" *ngIf="IsLogged">
<ion-icon slot="start" name="log-out-outline"></ion-icon>
<ion-label>{{'sidemenu.signout' | transloco}}</ion-label>
</ion-item>
<ion-item routerLink="dashboard" *ngIf="IsLogged">
<ion-icon slot="start" name="apps-outline"></ion-icon>
<ion-label>{{'sidemenu.app' | transloco}}</ion-label>
</ion-item>
I created an observable where returns the Islogged value as true, but after login the variable in the app-Component is not automatically updated, some method to make this update, for example the Component stay "listening" changes in the variable?
this._LoginService.Session().subscribe(data => { this.IsLogged = data.IsLOgged }).unsubscribe;
Just give me one console.log(date) to see what is coming, if nothing is coming there the problem is in this service!
– LeAndrade
It is arriving yes, this observable inclusive use throughout the APP.. but the menu does not update, since it loads before the user logs in.
– RRV