D
D
developerrr2015-07-30 19:07:35
JavaScript
developerrr, 2015-07-30 19:07:35

Expand/Collapses in angular?

Can you please tell me if there is a json like this:

{
    "id" : 101,
    "category" : 1,
    "order" : 1,
    "name" : "test"
},{
    "id" : 102,
    "category" : 1,
    "order" : 2,
    "name" : "test1"
},{
    "id" : 201,
    "category" : 2,
    "order" : 1,
    "name" : "test2"
},{
    "id" : 202,
    "category" : 2,
    "order" : 2,
    "name" : "test3"
},{
    "id" : 203,
    "category" : 2,
    "order" : 3,
    "name" : "test4"
},{
    "id" : 301,
    "category" : 3,
    "order" : 1,
    "name" : "test5"
}

What you need:
It is necessary that only the names from each category are displayed, those under id 101, 201, 301, etc. (that is, the first values). When you click on the text that is under id 101, the names in the column from its own categories (102, 103, etc.) would appear under it (like expand / collapse). And so for the rest of the categories. I hope I explained clearly. How can this be implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-07-31
Protko @Fesor

ng-repeat, ng-hide/ng-show.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question