[Solved] AngularJS Error - Expected to be a Date

Last Reply 10 days ago By Mudassar

Posted 14 days ago


After clicking of edit button i need to display relevant date value on date textbox and save to database

I have tried a lot but didn't get any solution

Could you please kindly help me

 $scope.mahesh = $scope.mahesh ? false : true;
            var getData = myService.getState(state.Id);
            getData.then(function (emp) {
                $scope.employee = emp.data;
                $scope.Id = state.Id;
                $scope.Name = state.Name;
                $scope.ToDate = state.ToDate;
                $scope.Action = "Edit";



Posted 10 days ago
mahesh213 says:
  $scope.ToDate = state.ToDate;

 Change to

 $scope.ToDate = new Date(state.ToDate);

and try