Dynamic Filter ng-repeat

2

I need to insert a dynamic filter, which comes from a select, into my ng-repeat

select ng-model="campoBusca"

input type="text" ng-model="busca"

ng-repeat="funcionario in funcionarios | filter: { campoBusca: busca}"

But is not it right, some other alternative?

    
asked by anonymous 10.06.2014 / 21:42

1 answer

1

Could you further specify your question? is half empty.

If this is really what I understand, the solution below should resolve:

$scope.campoBusca= {campo1:'', campo2:''}


<ng-model="campoBusca[selecionado]">
<ng-repeat="funcionario in funcionarios | filter: { campoBusca: busca}" >

Here's an example (already existing): JSFiddle

    
10.06.2014 / 23:23