2
I have the following HTML code:
<form name="formProfissional">
<label>Data</label>
<input class="form-control" type="date" name="dia" ng-model="agenda.dia" required>
<label>Hora</label>
<input class="form-control" type="time" name="hora" ng-model="agenda.hora" required>
<button class="btn btn-block btn-primary btnAdicionar" ng-click="setAgenda(agenda)">Adicionar</button>
</form>
And this controller:
app.controller("AgendaProfissionaisCtrl", ['$scope', '$http', '$window', '$location', '$rootScope', '$routeParams', function ($scope, $http, $window, $location, $rootScope, $routeParams) {
$rootScope.idestabelecimento = localStorage.getItem('idestabelecimento');
$scope.idprofissional = $routeParams.idprofissional;
// $scope.nome;
var getPro = function(){
var idpro = $scope.idprofissional;
var opcao = 1; //Pegar profissional
$http.get("http://localhost:8888/sistemas/Android/areaAdmin/api/admin_estabelecimento/agendaProfissionais.php?opcao="+opcao+"&idpro="+idpro).success(function(response){
$scope.nome = response.nome;
})
}
getPro();
$scope.setAgenda = function(agenda){
agenda.idpro = $scope.idprofissional;
var mes = new Date(agenda.dia).getMonth() + 1;
var dia = new Date(agenda.dia).getDate();
var ano = new Date(agenda.dia).getFullYear();
var hora = new Date(agenda.hora).getHours();
var min = new Date(agenda.hora).getMinutes();
agenda.dia = ano+'-'+mes+'-'+dia;
agenda.hora = hora+':'+min;
console.log(agenda)
}
}]);
And on the console, although the correct data appears, this warning appears:
Does anyone know why this warning?
Angular version?
– Jéf Bueno
angular.js is v1.4.7 while angular.min.js is v1.5.7
– GustavoSevero