I want to display a list of student that has many subjects and each subject has many bills along with it. I want to set title inside each subject name that display all bills related to it. Right now I'm having a trouble of separating subject by bills like for each bill they will call subject again.
<h3>List of Student</h3> <div *ngFor="let key of students | async; index as studentId"> <h2> <a> {{key.studentId}} </a>. {{key.studentName}} </h2> <div *ngFor="let elements of key.subjectSS"> <div *ngFor="let billDetail of elements.billSS"> <b>Subject:</b><span [title]="'Học phí: ' + billDetail.price"> {{elements.subject.subjectName}}</span><br /> <span> <b>Bill:</b> {{billDetail.price}} VNĐ<br /> </span> </div> </div> </div> My Screen Display My Json
[ { "subjectSS": [ { "subject": { "studentSS": [], "subjectId": 1, "subjectName": "Math" }, "billSS": [ { "billId": 1, "price": 500, "reqStuSubId": 1 }, { "billId": 2, "price": 700, "reqStuSubId": 1 }, { "billId": 7, "price": 2400, "reqStuSubId": 1 } ], "reqStuSubId": 1, "studentId": 1, "subjectId": 1 }, { "subject": { "studentSS": [], "subjectId": 2, "subjectName": "Geography" }, "billSS": [ { "billId": 6, "price": 1000, "reqStuSubId": 2 }, { "billId": 9, "price": 424, "reqStuSubId": 2 } ], "reqStuSubId": 2, "studentId": 1, "subjectId": 2 } ], "studentId": 1, "studentName": "Hung" }, { "subjectSS": [ { "subject": { "studentSS": [], "subjectId": 3, "subjectName": "Physical" }, "billSS": [ { "billId": 5, "price": 900, "reqStuSubId": 7 }, { "billId": 8, "price": 745, "reqStuSubId": 7 } ], "reqStuSubId": 7, "studentId": 2, "subjectId": 3 } ], "studentId": 2, "studentName": "Manh" }, { "subjectSS": [], "studentId": 3, "studentName": "Long" } ]

