title: Substr in angularJS to fetch the initials of the full name
body: <p>My question is related to creating substr in Angular.JS</p>
  
  <p>Suppose i have a model:</p>
  
  <pre><code>$scope.myName = 'John Smith'
  </code></pre>
  
  <p>but when during the rendering of the model on the page i need only the initials of the name like:</p>
  
  <pre><code>&lt;p&gt;{{myName | some directive/filter }}&lt;p&gt;
  </code></pre>
  
  <p>Output should be :: JS</p>
  
  <p>i tried creating many directives but unable to fetch the exact output even i have tried the limitTo filter but it give only the starting first 2 letters of the name.</p>
  
  <p><a href="https://plnkr.co/edit/HM5MM3ps6wclRqeqKpQx?p=preview" rel="nofollow">Workbook is here</a></p>