Having trouble parsing A url object how I would like, still new to url strings would love some help. My object looks like this :
{mod1: "/hello/world", mod25: "/hey/jude/how/are/you"}
and I need to parse it into something like this
{
"mod1" : {"hello" : ["world"]},
"mod2" : {"hey" : ["jude","how","are","you"]}
}
How do I parse this url into an object like so? Thanks!
Edit: so far
var parseObj = $location.search();
_.each(parseObj, function(ob){
console.log(ob.split());
});
This gives me back the strings, however i am not sure how to now split them into an object where the key is the first item