I have the following Js/Json. I am trying to create a search box so I can search the item in the list. From the api I am getting the below object. It has 2000 items, that I would like to do a search on. When I type in a search, it should update the found items that includes the typed in words real-time(two way binding)
I think using a Pipe is too slow? I struggle to understand whether this is a jsObject or json object.
Also if I search of it it will display 1900 results how do I limit those results to 8?
I tried several pipes and the below loop but this doesn't work.
objectFromApi = {"item1": "valueItem1, "item2", "valueItem2}
var keys = []
var keys = Object.getOwnPropertyNames(objectFromApi)
for(var i=0;i<keys.length;i++){
if(keys[i].indexOf(str) != -1){
this.resultArr.push(keys[i]);
}
}