title: Json stringify then parse from URL
body: <p>I seem to be having an issue in stringify'ing then pasing from a url object</p>
  
  <p>I simply stringify my object and set the location (with angulars $location) like so </p>
  
  <pre><code> currentUrl = {"module1" : {"is" : true} }
   $location.search(JSON.stringify(currentUrl));
  </code></pre>
  
  <p>So this parses to the url just fine, however when I try to grab it from the url i get this back   </p>
  
  <pre><code>     console.log($location.search());
        ---
       Object {{"module1":{"is":true}}: true}
  </code></pre>
  
  <p>How do I parse this back into an object so I can use it? If I do </p>
  
  <pre><code> JSON.parse($location.search());
  </code></pre>
  
  <p>I get a syntax error. I maybe because of how search returns the object? I am a bit confused here, could use some help. Thanks!</p>
  
  <p>So I put it in the url with </p>
  
  <pre><code>   $location.search(JSON.stringify(currentUrl));
  </code></pre>
  
  <p>What are the steps I need to take to get it back into this form : </p>
  
  <pre><code> {"module1" : {"is" : true} }
  </code></pre>
  
  <p>Edit - </p>
  
  <p>It just appears it's setting the json object as the key in the location like</p>
  
  <pre><code> { "mystrigifiedobject": true }
  </code></pre>
  
  <p>Edit2 : </p>
  
  <p>based off the first edit, I was able to solve it (assming it's set in the locations object key) like so  :</p>
  
  <pre><code>  currentUrl = $location.search();
                      currentUrl = JSON.parse(Object.keys(currentUrl));
                      console.log(currentUrl);
  </code></pre>
  
  <p>This just feels a little weird though, am I doing something wrong here?</p>