How to auto-filter with ng-repeat?

0

I'm trying to do a self-filtering but when I set the values, it takes them but does not filter the data the code I use is the following ..

the filter is here - >

<input type="text" id="{{item.descripcion}}" ng-model="searchinput" style="color:black" value="{{item.descripcion}}" readonly>  

and it happens that it does not take the value to filter the data although if the value is set, it only works when I write data to it within the input

Can someone guide me?

      <div class="box  box-solid collapsed-box " id="oficinas" ng-repeat="item in claves">

                        <div  class="box-header" data-widget="collapse" onclick="asignar()">



                            <h2 class="box-title" display="block" style="float:left; margin-left:2%;"> {{item.documentos}} </h2>
                            <img class="change" src="css/galeria/down.png" style="float:right; width:7%;margin-right: 5%; margin-top: 4%;" />

                            <p id="typee" value="{{item.descripcion}}"></p>
                            <div class="box-tools pull-right">


                            </div>
                        </div>
                        <div class="box-body" id="uniq" ng-controller="detalle_referenciacontrol">
                            <!--aqui esta el filtro-->
<input type="text" id="{{item.descripcion}}" ng-model="searchinput" style="color:black" value="{{item.descripcion}}" readonly>                          
                            <center>

<table class="table table-hover" style="margin:auto">
<tbody>
<tr ng-repeat="item in itemsarchivo | filter:{tipodescrip:searchinput}" id="{{item.path}}" onclick="ver(this)">
                                            <td><b style="float:left;">{{item.nombre}}</b></td>
                                            <td style="text-align:right"><img src="css/galeria/doc.png"></td> 


                                        </tr>
                                    </tbody>
                                </table>
                            </center>
                        </div>
                        </div>
    
asked by emanuelle 28.07.2018 в 00:17
source

1 answer

0

Try something like this

ng-repeat="item in itemsarchivo | filter:searchinput"

You can see more options and filter details here link

    
answered by 28.07.2018 в 01:05