I am trying to set a url with an object I have created (in angular). It is an object array I would let to set on the url string to do a kind of "save state".
I have my object like -
[{"key1" : true}, {"key2" : false}];
And I basically want to set that as a url object so I can get a custom url string for my state - which would then be interpreted on landing to change a state (so users can send custom urls).
So before when it was just one object, I could pass the object and do something like
$scope.myObject = true;
$location.search($scope.myObject);
But I am trying to combine a few of the objects into one big object so I can keep track of a few different states in one place (in a factory). The problem I am having is I cannot seem to get it to work if the the location.search parameter is an array of objects. I'm getting an "undefined is not a function" and it's pointing inside angular.
Are there any tricks to this? Could use some help, this is my first time trying this. Also, I'm trying to change the url without refreshing. Thanks!
{and ends}. An object can contain array(s).