mercredi 22 février 2017

How to filter list displayed through ng-repeat with muliple fields using checkboxes

I have a JSON like below:

var data = [
{
  "id": 1,
  "name"; "Test1",
  "isPending": "false",
  "isCompleted": "true",
  "isRequired": "true",
  "location": [
    {
      "city": "London",
    },
    {
      "city": "New York",
    }
   ]
},
{
  "id": 2,
  "name"; "Test2",
  "isPending": "false",
  "isCompleted": "false",
  "isRequired": "true",
   "location": [
    {
      "city": "Mumbai",
    },
    {
      "city": "New York",
    }
   ]
}
}

..
..
];

I want to have 5 checkboxes filters for fields below:

  1. Pending
  2. Completed
  3. Required

Cities:

1.Mumbai

2.London

I am displaying the data using ng-repeat.

How to apply filter in AngularJS having checkboxes for multiple fields. Basically it should work as OR operator.




Aucun commentaire:

Enregistrer un commentaire