First of all: Plunkr Example is here <-- NOW: WORKING EXAMPLE (edited)
This is the data:
[
{
"label": "One",
"value": 1
},
{
"label": "Two",
"value": 2
},
{
"label": "Three",
"value": 3
}
]
This is the filter:
http.get('./data.json')
.map(data => data.json())
.filter (
(x,index) => return x[index].value === 2
)
.subscribe(data => this.d = data);
I would like to get as result:
{
"label": "Two",
"value": 2
}
Maybe I've a blackout, where is the mistake?