title: Ucwords filter in angularjs throwing error
body: <p>Something strange is happening. Actually I am assigning a title from asynchronous call and I'm applying a <code>ucwords</code> filter on the title. It is giving me the proper output but throwing the error first and after then showing the proper value. </p>
  
  <p><strong>HTML snippet:</strong></p>
  
  <pre><code>&lt;h1 ng-show="defaultProduct.Campaign.title"&gt;{{ defaultProduct.Campaign.title | ucwords }}&lt;/h1&gt;
  </code></pre>
  
  <p><strong>Filter Snippet</strong></p>
  
  <pre><code>app.filter("ucwords", function () {
      return function (input){
          input = input.toLowerCase().replace(/\b[a-z]/g, function(letter) {
              return letter.toUpperCase();
          });
          return input; 
      }    
  })
  </code></pre>
  
  <p>Please note <code>defaultProduct.Campaign.title</code> is assigning from AJAX call. It initializes after ajax success. In my console it is throwing the error first and after ajax success call it is showing proper output. </p>
  
  <p>If input is <code>show me first title</code> then output will be <code>Show Me First Title</code>. <strong>But why it is throwing the error first</strong> ? I'm thinking to use <code>$timeout</code> in filter but it would not a good way of doing that. Can anyone suggest me best way ? </p>
  
  <p><strong>Below is the error</strong> :</p>
  
  <pre><code>Error: input is undefined
  </code></pre>