Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
Angular browser version returns value as null when URL is called

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!