title: AngularJS DatePicker value is returning undefined
body: <p>Im trying to pass the date from a date picker value into a $http session parameter (like "2017-12-7"), but the date my datepicker Date variable is 'undefined'</p>
  
  <pre><code>angular.module('MyApp', ['ngMaterial']).controller('MyController',
              function($scope, $http) {                   
  
                    this.myDate = new Date();
                    this.minDate = new Date("December 4, 2017");
                    this.maxDate = new Date("December 10, 2017");
  
                    $scope.getDataFromServer = function() {
  
                        var dt = this.myDate;
  
                          $http({
  
                              method : 'GET',
                              url : 'myurl',
                              params : {
                                  pdate : this.myDate
                              }
                          }).then(function mySuccess(response) {
                              $scope.datacontainer= response.data;
                          }, function myError(response) {
  
                          });
                      };
  
          });
  </code></pre>
  
  <p>The <strong>$scope.getDataFromServer</strong> method is called when you click a button. 
  The following line <strong>var dt = this.myDate;</strong> was to look at the myDate object in chrome DevTools (F12) and it says 'undefined'.</p>
  
  <p>The date picker HTML is as follows:</p>
  
  <pre><code>&lt;div flex="20"&gt;
    &lt;md-datepicker ng-model="myDate" md-placeholder="Enter date" md-min-date="ctrl.minDate" md-max-date="ctrl.maxDate"&gt;
    &lt;/md-datepicker&gt;
  &lt;/div&gt;
  </code></pre>