Recently diving into Angular, I am facing a challenge with filtering data from a JSON array. My goal is to display names of items whose id is less than 100. The code snippet below, however, is not producing the desired result.
list : any;
getOptionList(){
this.callingService.getData().pipe(
filter((l) => l.id < 100)
).subscribe(
(l) => { this.list = l;}
)
}
}
JSON Array retrieved from calling Service
[
{
"id":1,
"name": "A"
},
{
"id":2,
"name": "B"
},
...
]