I'm new to angular and I was working on an angular project. There is a problem I'm facing is that, after each component routing the data from is not displayed at first but after reloading the page the data is displayed as shown here 
[![after reload][2]][2].
and [2]: https://i.stack.imgur.com/Wn3Bv.png
the code used in service is
import { Injectable, SimpleChange } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { BehaviorSubject, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { DatePipe } from '@angular/common';
import { environment } from 'src/environments/environment';
import { RouterModule, Routes, ActivatedRoute, Router } from '@angular/router'
@Injectable({ providedIn: 'root' })
export class UserService {
public userList = [];
public userData = [];
public header: any;
public userkeypair: any;
constructor(private http: HttpClient,
private router: Router) {
this.header = new HttpHeaders()
.set("Authorization", 'Bearer ' + JSON.parse(localStorage.getItem('token')));
}
ListAlUsers() {
this.http.get<any>(`${environment.apiUrl}GetAllEndUsers`, { headers: this.header })
.pipe(map(rese => {
return { rese }
}))
.subscribe((result: any) => {
this.userList.push(result);
this.userData = this.userList[0].rese;
var stst: any;
var useraary:any=[];
for (let i = 0; i < this.userData.length; i++) {
if (this.userData[i].status == "True") {
stst = "Active";
} else {
stst = "Inactive";
}
this.userkeypair = {
"id": this.userData[i].id, "name": this.userData[i].fullName, "email": this.userData[i].emailId, "account": this.userData[i].relatedAccount,
"status": stst
}
useraary.push(this.userkeypair);
}
sessionStorage.setItem('userlist',JSON.stringify(useraary));
});
}
}
and the component.ts is
import { Component, OnInit } from '@angular/core';
import{UserService} from './user.service';
@Component({
selector: 'app-user',
templateUrl: './index.component.html',
styleUrls: ['./index.component.css']
})
export class userComponent {
public Userlst=[];
constructor(private UserService:UserService) {
this.UserService.ListAlUsers();
this.Userlst=JSON.parse(sessionStorage.getItem('userlist'));
}
}
please help me with this