title: Stuck on AngularJS Filter
body: <p>I have the below custom filter that will truncate text after a certain number of characters:</p>
  
  <pre><code>test.app.filter('cut', function () {
  return function (value, wordwise, max, tail) {
      if (!value) return '';
  
      max = parseInt(max, 10);
      if (!max) return value;
      if (value.length &lt;= max) return value;
  
      value = value.substr(0, max);
      if (wordwise) {
          var lastspace = value.lastIndexOf(' ');
          if (lastspace != -1) {
              value = value.substr(0, lastspace);
          }
      }
  
      return value + (tail || ' …');
  };
  });
  </code></pre>
  
  <p>If I apply it to ng-options, it does not work - the options in the drop down disappear:</p>
  
  <pre><code>&lt;select name="country" class="form-control" ng-options="country.value as country.label for country in countries | cut:true:20:' ...'" ng-model="address.Country" placeholder="{{'Country' | r | xlat}}" ng-required="address.IsCustEditable != false" ng-disabled="address.IsCustEditable == false" /&gt;
  </code></pre>
  
  <p>It works great though in other elements, such as this:</p>
  
  <pre><code>  &lt;strong&gt;{{v.ExternalID | cut:true:20:' ...'}}&lt;/strong&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>