title: set current date on datepicker AngularJS
body: <p>So, a modal opens up when I click on a button on m md-card to select a date. This is the code for it:</p>
  
  <pre><code>      &lt;!-- Modal --&gt;
   &lt;md-dialog aria-label="Date Picker"&gt;
      &lt;div class="modal-content"&gt;
          &lt;div class="modal-header"&gt;
              &lt;button type="button" class="close" data-dismiss="modal"
                  aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
              &lt;h4 class="modal-title" id="myModalLabel"&gt;{{modalTitle}}&lt;/h4&gt;
          &lt;/div&gt;
          &lt;!-- /.modal-header --&gt;
          &lt;div class="modal-body"&gt;
              &lt;md-input-container flex&gt; &lt;input type="date"
                  ng-model="startDateL"&gt; &lt;/md-input-container&gt;
              &lt;md-input-container flex&gt; &lt;label&gt;{{}}&lt;/label&gt; &lt;input
                  type="date" ng-model="endDateL"&gt; &lt;/md-input-container&gt;
              &lt;!-- /.modal-search-box --&gt;
  
              &lt;md-button ng-click="setDate()" class="md-primary"&gt;Update
              Date&lt;/md-button&gt;
          &lt;/div&gt;
          &lt;!-- /.modal-body --&gt;
      &lt;/div&gt;
      &lt;!-- /.modal-content --&gt;
  &lt;/div&gt;
  &lt;!-- /.modal-dialog --&gt;
  &lt;/div&gt;
  &lt;/md-dialog&gt;
  &lt;!-- /.modal --&gt;
  </code></pre>
  
  <p>and this is the code for my controller to select a date</p>
  
  <pre><code>function datePickerController($scope, $mdDialog, $rootScope, datePickerFactory, $filter){
      console.log("suntem in date picker sel");
      $scope.startDateL = new Date($rootScope.startDate);
      $scope.endDateL = new Date($rootScope.endDate);
  
      $scope.close = function() {
          $mdDialog.hide();
          console.log("closing");
      }
  
  
  
      $scope.setDate = function(startDate, endDate) {
          $rootScope.startDate = $scope.startDateL;
          $rootScope.endDate = $scope.endDateL;
  
          var stDate = $filter('date')($rootScope.startDate,'yyyy-MM-dd');
          var enDate = $filter('date')($rootScope.endDate,'yyyy-MM-dd');
  
          console.log(stDate);
          console.log(enDate);
  
          datePickerFactory.save({sDate: stDate, eDate: enDate}, function(){
          })
  
          localStorage.setItem('chosenStartDate', JSON.stringify($rootScope.startDate));
          localStorage.setItem('chosenEndDate', JSON.stringify($rootScope.endDate));
          $rootScope.$broadcast("dateWasChosen");
          $mdDialog.hide();
  
      }
  
  }
  </code></pre>
  
  <p>Now, what i want to do is to set a current date on my date field in my modal so that I have a default date when i open my modal.Is there a function that can set the current date?</p>