Angular - capture datapicker value

1

Hello, I have a problem with an angled application 2, I have 2 Datepicker

<input type="text" data-date-format="dd/mm/yyyy" class="form-control pull-right" ng-model="ctrl.campanha.dataInicial" id="datepicker1" ng-init="initDatepicker1()">

<input type="text" data-date-format="dd/mm/yyyy" class="form-control pull-right" ng-model="ctrl.campanha.dataFinal" id="datepicke2" ng-init="initDatepicker2()">

I am initializing them in my Controller using the following methods

$scope.initDatepicker1 = function () {

            $('#datepicker1').datepicker({
                autoclose: true
            })
        }

        $scope.initDatepicker2 = function () {
            $('#datepicke2').datepicker({
                autoclose: true
            })
        }
function validacoes() {


        console.log(vm.campanha.dataInicial)
        console.log(vm.campanha.dataFinal)
        return true
    }

When I try to retrieve the values of Datepicker by means of the function validacoes() , which is called by means of an ng-click / em>, although they appear inside the input values, see:  

How can I resolve this problem?

    
asked by anonymous 03.10.2017 / 15:58

0 answers