title: Assigning a session object to an Angular object
body: <p>I've created an Angular app that stores data in the browser session. The value of one of those keys happens to be an stringified key:value object. <code>key:"{key:value, key:value, ...}"</code></p>
  
  <p>When I return the string from sessionStorage I parse it to recreate the object using <code>JSON.parse</code> or <code>angular.fromJson</code> (both have the same results) and store it as a variable. I can <code>console.log</code> it at this point and clearly see the JSON object, in all its glory -- exactly as I expect it. When I assign this object as an angular variable it assigns the object itself, not the key:values.</p>
  
  <pre><code>var myParsedObj = JSON.parse(sessionStorage.getItem('my_object_string'));
    console.log(myParsedObj); // returns Object {key:value, key:value, ...}
  $scope.myParentObject.myObject = myParsedObj;
    console.log($scope.myParentObject.myObject); // returns [object Object]
  $scope.myObject = myParsedObj;
    console.log($scope.myObject); // returns Object {key:value, key:value, ...}
  </code></pre>
  
  <p>Compounded on that is that when I set the $scope to be myParsedObj it also inexplicably sets the sessionStorage item, which also becomes [object Object].</p>
  
  <p>Furthermore, if myParentObject is removed and myObject is attached directly to the $scope, it works fine and binds the data correctly. Is this a bug or am I doing something wrong? Is there a workaround I can employ? I've tried using angular.forEach as well as angular.extend without any success.</p>