I'm new to Angular 5, I'm creating a project and I'm having a problem. When I do the http.get request and my page automatically redirects to home. Every time I click to open new page it loads the data and redirects to the dashboard, has anyone ever had this problem?
Below the call I'm making:
ngOnInit() {
this.loadData();
}
loadData(): void {
this.http.get<any>('${environment.api_url}/auth/me').subscribe(response =>
{
this.user = response.user;
});
}
Thank you!