title: Angular 6 - value in textarea showing as Object Object
body: <p>I have some data stored using localstorage and saved using stringify and I want to add the data to a textarea.</p>
  
  <p>Here are the code parts:</p>
  
  <pre><code>{
    "name":"some name"
  }
  </code></pre>
  
  <p>To get is I'm doing this:</p>
  
  <pre><code>this.mydat = localStorage.getItem('mydata');
  </code></pre>
  
  <p>I have this in the localstorage in a variable called mydata</p>
  
  <p>So a console log to this.mydat will give me this:</p>
  
  <pre><code>{
    "name":"some name"
  }
  </code></pre>
  
  <p>Now I want to add this to the textarea, so I'm doing this:</p>
  
  <pre><code>this.con.nativeElement.value = JSON.parse(this.mydat);
  </code></pre>
  
  <p>This shows as:</p>
  
  <pre><code>[object Object]
  </code></pre>
  
  <p>on the Textarea.</p>
  
  <p>What I want to see is something like this:</p>
  
  <pre><code>{
      name : 'some name'
  
  }
  </code></pre>
  
  <p>On my textarea I've added the json pipe:</p>
  
  <pre><code>{{ thecontents | json }}
  </code></pre>
  
  <p>So in theory it should show a js object?</p>
  
  <p>How can I fix this?</p>