title: angular-ish function to output lorem ipsum text in a template?
body: <p>I want some mechanism to input random placeholder text in my templates. For now I just thought filters would fit the bill. Hence I wrote something like this:</p>
  
  <pre><code>angular.module('web')
  .filter('lorem', function(){
    var json = [
      //..data
    ];
  
    return function(_, ord) {
      var index = Math.floor(Math.random() * 10);
      console.log('Index1:', index);
      if (index &gt;= json.length) {
        index = json.length - 1;
      }
      console.log('Index2:', index);
      return json[index][ord];
    }
  });
  </code></pre>
  
  <p>Here is an example of how its consumed in a template:</p>
  
  <pre><code>{{'' | lorem:'text1' }}
  </code></pre>
  
  <p>Plunk: <a href="http://plnkr.co/edit/uL4AAYmmbWkC8ofQ00FO?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/uL4AAYmmbWkC8ofQ00FO?p=preview</a></p>
  
  <p>Is there a better way to do this?</p>