F
F
Friend2018-05-04 14:39:11
JavaScript
Friend, 2018-05-04 14:39:11

How to write dynamic filters in Angular?

For example, via the API, a large json comes to Angular, which has many keys with values ​​​​by which you can filter.
How to push all the values ​​of the keys dynamically into the filter and checkbox "to filter them?
Name keys and they contain different names "Oleg, Ivan, Stepan, Garik" and they can be supplemented or reduced.
JSON example:
[{"a": "vanya ", "b": 22}, {"a": "sergey", "b": 21}, {"a": "oleg", "b": 22}, {"a": "vanya", "b": 20}]
The values ​​in the key a and b can change and the keys can be 5 or 10 or 20.
For example, a filter is generated by the key a and a checkbox is created ("vanya", "sergey", "oleg"
Thanks in advance)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question