Good night, I'm trying to get the CRUD in my application, using AngularJS
and WEBService
, when I'm going to change data for a particular driver, I send JSON
of it to% %, on the change page, access the object, as well as its attributes through SessionStorage
of the inputs.
When not dealing with dates, ng-model
is populated with input
data, however, when dealing with dates, SessionStorage
has the following error in the console:
Error: [ngModel: datefmt].
Would anyone know how to solve this error? I could not find answers until then. Thank you in advance!
My input:
<label> Data de validade </label>
<input type="date" ng-model="motorista.data_vencimento" id="codigo_motorista" />
My method that sends the object in format AngularJS
to JSON
:
$scope.enviarDados = function(motorista){
$scope.jsonObj = angular.toJson(motorista, false);
window.sessionStorage.motorista = JSON.stringify(motorista);
window.location.href = "formAlterarMotorista.jsp";
}