The constructor for my page is as follows…
constructor(public navCtrl: NavController,
public navParams: NavParams,
public authenticationManager: AuthenticationManager)
{
this.events.subscribe('login:success', this.loginSuccess);
}
I have a Event Subscriber as follows
loginSuccess(user: any) {
console.log('Welcome', user.id);
this.navCtrl.setRoot(HomePage);
this.channelManager.getAll();
}
I receive an error when it runs setRoot because the this.navCtrl is null.
Is there any better way to do this? or to get this working properly?
Any help would be appreciated