I'm trying to apply a filter inside an ng-if, but I do not come up with the solution.
I have an arrangement of objects of this type:
tiempos = [
{
id: 39,
nombre: "Juan",
tiempos: [
{
vuelta: 1,
tiempo: "16.15",
terminado: 1
},
{
vuelta: 2,
tiempo: "16.07",
terminado: 1
}
]
},
{
id: 40,
nombre: "Pedro",
tiempos: [
{
vuelta: 1,
tiempo: "18.14",
terminado: 1
},
{
vuelta: 2,
tiempo: "0",
terminado: 0
}
]
},
{
id: 41,
nombre: "Paco",
tiempos: [
{
vuelta: 1,
tiempo: "17.32",
terminado: 1
},
{
vuelta: 2,
tiempo: "0",
terminado: 0
}
]
},
]
What I need is to filter by the "finished" property that is equal to 1 of the "second element" of the property "times".
That is, I only show the elements that have "finished: 1" in the second path, for this example that only shows the object with id 39.
Using
ng-if="(tiempos | filter: {})"
In advance, thanks for your time.