title: Angular: Pass object to directive
body: <p>I'm looking for a way to pass an object into a <code>directive</code>, but it turns up as a string. </p>
  
  <p>Given this template:</p>
  
  <pre><code>&lt;div my-directive="{ name: 'Roger', orders: ['apple', 'pie'] }"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>How can I get an object back in the directive?</p>
  
  <pre><code>@Input('my-directive') initialData: any; //initial data is a string
  </code></pre>
  
  <p>I assume maybe something with <code>JSON.parse</code>, but not sure how?</p>