Skip to content
Advertisement

How to filter data on Object in Angular

I get data from backend with this function

JavaScript

and console.log(response) show JSON like below

JavaScript

What I want are data that have "is_family_member": false, for this I create this.personmembertrue = this.persons.filter(x => x.is_family_member === 'false')

this part of code show empty.

Any idea please how to show data with "is_family_member": false

Advertisement

Answer

Change the condition to:

JavaScript

See if that works.

Advertisement