I've exhausted all the solutions found online, but I'm still facing a persistent issue. Despite my efforts, whenever I try to log information in another component, it keeps showing as undefined.
(Just to clarify, the data being dealt with is an object array)
Snippet from the first component:
goToCart(): void{
let params = { queryParams: this.cart };
this.router.navigate(['/cart', params]);
}
Snippet from the second component:
ngOnInit(): void {
this.router.queryParamMap.subscribe(params => this.cart = params.getAll("cart"));
console.log(this.cart[0]);
}