Facebook wants to check out my privacy page that i put in the developers dashboard. So far so good. Now in the mysite.com/privacy i am calling a variable that is set from home page (mysite.com) so when they hit on their browser the privacy page (mysite.com/privacy) without visiting first the home page (mysite.com) then obviously the value is not set.
this is the error i am getting
ERROR TypeError: ctx.userDetails is null
MainHeaderComponent_Template template.html:9
.html page <div class="login-header-block" *ngIf="userDetails.username!='guest'">
.ts page
constructor(
private userData: UserData,
private router: Router,
private alertCtrl: AlertController,
) {
this.userDetails = this.userData.getUserData();
this.getNotifications();
}
I want to be able to keep the ngIf but i want it to show the page without errors
any help