title: What method is used for textual representation of the data in AngularJS?
body: <p>When you display some data using AngularJS they are presented as text. I would like to override the method used for this representation instead of writing each time something like <code>{{elem.print()}}</code>.</p>
  
  <p><strong>Question:</strong> which method should I define in my object to simply write <code>{{elem}}</code> and get (effectively) the same results as above?</p>
  
  <p><em>Longer version with example:</em></p>
  
  <p>Say you have collection of people, you write the repeater and inside you could:</p>
  
  <pre><code>{{person.name}} {{person.age}} {{person.address}}
  </code></pre>
  
  <p>But you could write for your object a method <code>print</code> which returns all that text, and then inside html you just write:</p>
  
  <pre><code>{{person.print()}}
  </code></pre>
  
  <p>But I would like to get rid of that call as well, I would like to write just</p>
  
  <pre><code>{{person}}
  </code></pre>
  
  <p>to get textual representation, <strong>my</strong> representation, not just a dump of the object. I hope AngularJS calls for some method per object which is supposed to be displayed. So my question is what is that method, it is not <code>toString</code> for sure, I've already checked.</p>