I am facing an issue with my Angular 2 item page. When a user lands on the page via a deep link, the Location.back() function does not work as there is no history in the Location object. To address this, I attempted to use a workaround where if the back() function fails, the app triggers the navigate() function. However, upon navigating back to the items page, an error is thrown:
clickGoToItemsPage() {
this._location.back();
this._router.navigate(['ItemsPage']);
}
The error message reads:
EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot read property 'constructor' of undefined
This error occurs after the second function is triggered and the page is on the ItemsPage. Can anyone suggest a solution for this issue?