title: How to get id from Mongoid in Angular?
body: <p>I uses Rails 4 and MongoDB by Mongoid gem.
  I have Angular template like this:</p>
  
  <pre><code>&lt;ul&gt;&lt;li&gt;&lt;a href="" ng-click="navNewEmail()"&gt;Add a new post&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
  
  &lt;section&gt;
    &lt;h1&gt;Availabe templates: (click to load content)&lt;/h1&gt;
    &lt;div ng-repeat="email in data.emails"&gt;
        &lt;h3&gt;&lt;a href="" ng-click="viewEmail(email._id)"&gt;{{ email.subject }}&lt;/a&gt; - author: {{ email.user_name }}&lt;/h3&gt;
  {{ email._id }}
    &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>How can I get a <code>id</code> of my <code>Email</code> object?
  I have simple <code>Email</code> object in MongoDB.
  I tried <code>email._id</code> but Angular display nothing.</p>
  
  <p>Everything works besides <code>{{ email._id }}</code> part.</p>
  
  <p>Log from JavaScript console:</p>
  
  <pre><code>$$hashKey   
      "005"
  
  _id     
      Object { $oid="5478774a6a61734d8a000000"}
  
  body        
      "Here is the sample conte...le ble ble. Nice email."
  
  subject     
      "This is first template"
  
  user_name       
      null
  </code></pre>
  
  <p>So <code>_id</code> is the object. How can I convert it into string and display in angular template?</p>
  
  <p>I do something like this:</p>
  
  <pre><code>  {{ email._id.$oid }}
  </code></pre>
  
  <p>I don't know is it correct but works.</p>