I need to filter an array of objects where specific property matches what user has type.
given this
peopleList = [
{name: "john bee", age:23},
{name: "john woo", age:43},
{name: "jim foo", age:101},
{name: "bob wow", age:67},
{name: "last john", age:43},
]
As soon as the user types the first character I would like to filter the array based not on exact match but on what "where like".
I've check this question: Filtering array of objects with lodash based on property value
but it returns only one exact match or nothing.
What lodash function can I use to return an array of objects where name property matched the query string entered by the user so that if user types 'Jo' this is returned:
[
{name: "john bee", age:23},
{name: "john woo", age:43},
{name: "last john", age:43},
]
I am using Angular if that matters.