My goal is to utilize the ng-repeat
function to display the remaining data if the attribute is the same. To clarify, here is an example:
Consider a JSON sample, which consists of an array of books:
[{"Genre":"Sci-fic","Name":"Bookname1"},
{"Genre":"Sci-fic","Name":"Bookname2"},
{"Genre":"Non sci-fic","Name":"Bookname3"},
{"Genre":"Non sci-fic","Name":"Bookname4"}]
If books belong in the same genre, I want the genre type to serve as the heading of the accordion and list the attributes for those books without repeating the heading. The issue I'm facing is that since the json array of objects comes from a data model, I can't filter the type without replicating the genre entry.
The structure I currently have involves setting the Book.Genre as the accordion heading, with each accordion-group containing a list of all books belonging to that genre.
For more information, you can visit: http://plnkr.co/edit/PwIrOAIT3RRaE2ijzGZb?p=preview