I have a very strange problem. I have some filters that look like this.
<div ng-show="filtroReduzido" class="col-md-2">
<div class="form-group">
<label>Codigo Reduzido</label>
<div class="form-group form-md-line-input no-hint right" style="padding-top: 3px;">
<select id="servico"
name="servico"
chosen
width="150"
allow-single-deselect="true"
ng-model="vm.filtro.des_servico"
style="width:100%"
ng-options="clienteFiltro as cliente.Des_Servico for cliente in vm.importacaoSiltDet |unique:'Des_Servico'| orderBy:'Des_Servico'"></select>
</div>
</div>
</div>
In the controller I declare the "filter"
vm.filtro = {};
In my function I call this ng-model
but it comes undifined
.
The dateDe and dateAte are receiving the parameters normally, and the vm.relatorio
is declared equal vm.filtro
.
I do not understand why the variables test2
and test3
are coming undifined
, am I forgetting any steps? maybe bind the values of the filter parameters?
vm.filtrarDetFiltrado = function () {
debugger;
var dateDe = formatarData(vm.relatorio.dataDe);
var dateAte = formatarData(vm.relatorio.dataAte);
var test2 = vm.filtro.des_servico;
var test3 = vm.filtro.Des_Servico;