I'm trying to pass an object as one of the parameters to my ui-router state:
JS:
.state('graph', {
name: 'Graph',
url: "/graph?{friends}&{start}&{end}",
templateUrl: 'templates/graphs.html',
controller: 'GraphController'
})
HTML:
<a ui-sref="graph({friends: test.friends, start: test.start_date, end: test.end_date})">
My Graphs
</a>
TEST:
{
friends: {
'friend1': [MORE_DATA],
'friend2': [MORE_DATA]
},
start_date: "Jun-17",
end_date: "Jun-19"
}
However, when I try to access $stateParams in the controller, it prints out the string "[object Object]". How can I get the test.friends object to be passed through?