I'm using ngx-filter-pipe with angular 4 and I'm stuck with this issue. I managed to filter with one value and now im trying to filter data with more than one value: Here's what I got This is my component:
@Component({
selector: 'deudas-list',
templateUrl: '../views/deudas-list.html',
providers: [ DeudaService ]
})
export class DeudasListComponent{
public titulo: string;
public deudas: Deuda[];
public userFilter: any = { mes: '' };
constructor(
private _route: ActivatedRoute,
private _router: Router,
private _productoService: DeudaService
) {
this.titulo = 'Listado de Pagos:';
}
ngOnInit() {
this._productoService.getDeudas().subscribe(
result =>{
console.log(result['Cuotas'].Cuota);
this.deudas = result['Cuotas'].Cuota;
},
error => {
console.log(<any>error);
}
);
}
}
This is my view
<div class="form-group has-feedback">
<label for="term" class="sr-only">Search</label>
<input type="text" name="term" [(ngModel)]="userFilter.mes" class="form-control" id="term" placeholder="Buscar por mes...">
<span class="glyphicon glyphicon-search form-control-feedback"></span>
</div>
<div *ngIf="deudas" class="table-responsive col-lg-12 tablilla">
<table class="table table-bordered table-striped table-responsive">
<tbody>
<tr *ngFor="let deuda of deudas | filterBy: userFilter | paginate: {itemsPerPage:10,currentPage: p}">
<td>{{deuda.nombre_edificio}}</td>
<td>{{deuda.numero_dpto}}</td>
<td>{{deuda.Annio}}</td>
<td>{{deuda.mes}}</td>
<td>{{deuda.nombre_tipo_cuota}}</td>
<td>{{deuda.monto_cuota}}</td>
<td>{{deuda.nombre_estado_cuota}}</td>
<td>{{deuda.fecha_pago}}</td>
</tr>
</tbody>
</table>
<pagination-controls (pageChange)="p = $event" class="paginador"></pagination-controls>
</div>
I tried multiple things but I cant make it work Here's the documentation I'm following https://github.com/VadimDez/ngx-filter-pipe I cant get $or filter to work as shown
This is the data I'm getting from a ws
as you can see im using mes to filter but i'd like to use more than one
<input type="text" name="term" [(ngModel)]="userFilter.mes" class="form-control" id="term" placeholder="Buscar por mes...">
any help would be appreciated.