i want to change menu according to login logout. using all 3 options for subscribing data. but nothing working. not firing after logout/login.
firing only once on app load. and working after reload page but i dont want to reload page.
i want to change menu according to login logout. using all 3 options for subscribing data. but nothing working. not firing after logout/login.
firing only once on app load. and working after reload page but i dont want to reload page.
Use ionic events to check login/logout
not working in app.component.ts in v4 after app load
Can you share your code ?
app.component.ts
import { Events } from '@ionic/angular';
-------------------
constructor( private events: Events ) { this.initializeApp(); }
-------------------
public val:string;
-------------------
initializeApp() {
this.events.subscribe('hant', user => {
this.val = user;
});
}
login.ts
import { Events } from '@ionic/angular';
-------------------
constructor( private events: Events ) {}
-------------------
this.events.publish('hant', 'allow');