I have 2 api's called teachers and sessions.
teachers JSON file:
[
{
"teacherName": "Binky Alderwick",
"id": "01"
},
{
"teacherName": "Basilio Gregg",
"id": "02"
},
{
"teacherName": "Binky Alderwick",
"id": "03"
},
{
"teacherName": "Cole Moxom",
"id": "04"
}
]
sessions JSON file:
[
{
"id":"001",
"sessionName": "Chemistry",
"notes": "Chemistry is the study of matter, its properties",
"teacherIds": ["01","03"]<==========
},
{
"id":"002",
"sessionName": "Physics",
"notes": "Physics is the natural science that studies matter and its motion ",
"teacherIds": ["02","04"]
},
{
"id":"003",
"sessionName": "Maths",
"notes": "Mathematics includes the study of such topics as quantity",
"teacherIds": ["01","04"]<=========
},
{
"id":"004",
"sessionName": "Biology",
"notes": "Biology is the natural science that studies life and living organisms",
"teacherIds": ["02","04"]
}
]
Now i am displaying all the teachers in the template like this:
In the sessions JSON, I have mentioned the teacherIDs which is of array, I want to display the sessions of the particular teacher based upon the teachersID.
For ex the sessions (Chemistry & Maths) contains teacherID as (01),So i want to display these 2 sessions(Chemistry & Maths) under Teacher 1(i,e Binky Alderwick) Like this:
I should get all the properties of the session object based on the teacherId.

