I want to send an array of data within the .navigate()
of angular 8 routing module.
At the home component, the result of:
console.log(this.offers)
Is returning all available offers with all their related data.
After that, I am sending this.offers
within the navigate:
this.router.navigate(['/offers'], {queryParams:{ 'offers': this.offers}});
At the offers component, I tried to get the array of offers using:
console.log(this.activatedRouter.snapshot.queryParams.get('offers'))
But the result is just [Object Object]
.
I tried to use this.activatedRouter.snapshot.params['offers']
but it returned the same thing.
I tried the following:
console.log(this.activatedRouter.snapshot.queryParamMap.get('offers'))
But it returned an [Object Object]: