1
Good evening, I’m trying to accomplish the CRUD in my application, using AngularJS and WEBService, when I will change a certain driver’s data, I send the JSON from the same to the SessionStorage, on the change page, access the object as well as its attributes through the ng-model of inputs.
When it comes to dates, the input is filled in with data from SessionStorage, however, when it comes to the dates, the AngularJS displays the following console error:
Error: [ngModel:datefmt].
Would anyone know how to fix this mistake? I couldn’t find answers until then. Thanks 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 JSON to the SessionStorage:
$scope.enviarDados = function(motorista){
$scope.jsonObj = angular.toJson(motorista, false);
window.sessionStorage.motorista = JSON.stringify(motorista);
window.location.href = "formAlterarMotorista.jsp";
}
thanks for answering...how could I convert this "string data" to this format? I would do it where? In the controller or in my HTML?
– Matheus Minguini
my json is coming like this: {"id":13,"address":{"id_address":37,"street":"Av Taquaritinga","numero":188,"neighborhood":"Jd América","complement":"Next to Vaz Filho","cep":"14811223","city":"Araraquara","state":"São paulo","parents":"Brasil"},"provider":{"id":1,"name_fantasy":"test","razao_social":"test"},"code":"TEST","name":"Matheus Simões Minguini","observation":"Testing the change","rg":"404204065","Cpf":"45509939877","emissao_rg":"2017-02-13","orgao_expedidor_rg":"SSP","email":"[email protected]","telephone":"1633379410","cellular":"16997063747","cnh":"4564564645"{
– Matheus Minguini