Sagar Naliyapara Sagar Naliyapara - 22 days ago 9
AngularJS Question

Angular Material Date Picker Default Date Selected

This help me for date picker,

Now in this date-picker i want default selection of date and that default selection of date is should be current date.

can anyone help me how to set it?

Thank you.

Answer

In andgular material i have used this for datepicker and my issue of set current date is solved as follow,

Using AngularJs Controller,

HTML:

<input type="date" list="days" ng-model="transaction.date">

AngularJsController:

$scope.transaction.date = new Date();
(1) google components (2) datepicker demo (3) material demo