Link to home
Start Free TrialLog in
Avatar of ksd123
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?

<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();
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Prakash Samariya
Prakash Samariya
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial