Is it possible to send a complex object through a router? Here is what I am doing and trying to do:
On the search page, use can click a button on one of the results, which calls the method that calls this line. this.router.navigate(['profile-detail', selection]);
The object selectionlooks the same as before moving.
{
profile: {
id: number,
fname: string,
lname: string
},
contact: {
type: string,
address: string
},
books: [{
title: string,
author: string
}]
}
However, when we go to the profile details page, it this.route.snapshot.paramshas this as actual data:
{
profile: "[object Object]",
contact: "[object Object]",
books: "[object Object]"
}
source
share