ksd123
asked on
Get current system date using angularjs
Hi Experts,
I am using HTML5 calendar control and trying to display current system date initially when user navigates to this page using angularjs.Below is the code i have tried but not getting date in the calendar control.Can anyone let me know what is the wrong with below code?
I am using HTML5 calendar control and trying to display current system date initially when user navigates to this page using angularjs.Below is the code i have tried but not getting date in the calendar control.Can anyone let me know what is the wrong with below code?
<div ng-app ng-controller="Ctrl">
<label>To Date</label>
<input type="date" id="FromDate" name="FromDate" ng-model="FromDate" date-format="yyyy-MM-dd"/>
</div>
function Ctrl($scope)
{
$scope.FromDate = new Date();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.