title: How do I get masked date in model from input in angular using ui-mask?
body: <p>I have a view which requires that the user enter their birthdate into a textbox.</p>
  
  <p>I am using the mask directive from UI-Utils.</p>
  
  <p>My view has this input element in it:</p>
  
  <pre><code>&lt;input ui-mask="99/99/9999" placeholder="MM/DD/YYYY" type="text" name="uBirthdate" ng-model="user.birthdate" required/&gt;
  </code></pre>
  
  <p>and in my controller I have the scope set up as</p>
  
  <pre><code>myApp.controller('HomeCtrl', function ($scope, myService){
  
      $scope.user = registerService.getCurrentUser();
  
      $scope.submit = function () {
          //do something with $scope.user.birthdate
      };
  
      }
  });
  </code></pre>
  
  <p>My issue is that in my controller, the birthdate property contains the value from the input WITHOUT the masking characters so an input of</p>
  
  <p><code>11/20/1980</code> in the view becomes <code>11201980</code> as a property on the $scope</p>
  
  <p>How can I make sure I have a valid masked date to work with in my controller? Just FYI, this date will be sent as JSON in a POST request to my server.</p>